struts2拦截器interceptor的intercept(ActionInvocation invocation)使用问题
@OverridepublicStringintercept(ActionInvocationinvocation)throwsException{System.out....
@Override
public String intercept(ActionInvocation invocation) throws Exception {
System.out.println("MyInterceptor.intercept");//1
Map<String ,Object> sessionMap = invocation.getInvocationContext().getSession();
User user =(User)sessionMap.get("user");//3
System.out.println("aaaaaaaaaaa");
if (user!= null) {
System.out.println("username is :"+user.getUsername());
return invocation.invoke();
}
return "checkUserError";
}
后台只会打印1处,然后也不报错,myeclipse进入debug模式,断点在3处,请问这个代码有什么错误码? 展开
public String intercept(ActionInvocation invocation) throws Exception {
System.out.println("MyInterceptor.intercept");//1
Map<String ,Object> sessionMap = invocation.getInvocationContext().getSession();
User user =(User)sessionMap.get("user");//3
System.out.println("aaaaaaaaaaa");
if (user!= null) {
System.out.println("username is :"+user.getUsername());
return invocation.invoke();
}
return "checkUserError";
}
后台只会打印1处,然后也不报错,myeclipse进入debug模式,断点在3处,请问这个代码有什么错误码? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询