<interceptors>
<interceptor name="authority" class="com.app.invo.LoginInterceptor" />
<interceptor-stack name="mydefault">
<interceptor-ref name="defaultStack" />
<interceptor-ref name="authority" />
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="mydefault" />
这是XML里面的配置,
public String intercept(ActionInvocation invocation) throws Exception {
ActionContext ctx = invocation.getInvocationContext();
Map session = ctx.getSession();
Object user = session.get("uname");
System.out.println("enter");
if (null != user) {
System.out.println("enter1");
return invocation.invoke();
}
System.out.println("enter2");
return Action.INPUT;
}
这是authority拦截器里面的代码,只是看session里是否有记录判断用户是否登陆,在IE7下面没有问题,但是IE6下面,用户登陆后拦截器取uname的时候一直
为空,怎么这样啊IE7下面都没问题的啊,为什么6就出问题了呢?谁能帮帮忙啊,都晕死了
<interceptor name="authority" class="com.app.invo.LoginInterceptor" />
<interceptor-stack name="mydefault">
<interceptor-ref name="defaultStack" />
<interceptor-ref name="authority" />
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="mydefault" />
这是XML里面的配置,
public String intercept(ActionInvocation invocation) throws Exception {
ActionContext ctx = invocation.getInvocationContext();
Map session = ctx.getSession();
Object user = session.get("uname");
System.out.println("enter");
if (null != user) {
System.out.println("enter1");
return invocation.invoke();
}
System.out.println("enter2");
return Action.INPUT;
}
这是authority拦截器里面的代码,只是看session里是否有记录判断用户是否登陆,在IE7下面没有问题,但是IE6下面,用户登陆后拦截器取uname的时候一直
为空,怎么这样啊IE7下面都没问题的啊,为什么6就出问题了呢?谁能帮帮忙啊,都晕死了
解决方案 »
- jsp如何实现在线人数的统计
- 使用S2SH的错误
- CSS... 把一副小的图片变成一个按钮...就是图片的作用类似于提交表单的作用...
- 我从Servlet跳转到一个JSP页面,JSP中的图片为什么不会显示?
- 请各位帮忙看看这段日志!
- dom4j 解析xml 忽略 dtd 解决生成 Document 还是很慢 的问题
- JasperReport生成报表
- 寻一套jsp购物系统源码,烦请各位大侠帮忙
- 如何读取属性文件,急
- jsp中有没有类似dbgrid的数据感知web控件啊?100分相求!
- jsp页面 时间输出 格式 的本地时间与服务器时间为什么不一样呢?
- 关于JSP页面 显示 隐藏问题,高手进,在线等!!!!!!!!!!!!
return ActionContext.getContext().getSession();//from ActionContext here!
}
Here are the relevant lines of code from the interceptor.ActionContext actionContext = invocation.getInvocationContext();
HttpServletRequest request = (HttpServletRequest)
actionContext.get(StrutsStatics.HTTP_REQUEST);
HttpSession session = request.getSession(false);
if (session != null)
{
...
Collection actionMessages = validationAware.getActionMessages();
if (actionMessages != null && actionMessages.size() > 0)
{
session.setAttribute(ACTION_MESSAGES_KEY, actionMessages);
}
...
}