日期:2014-05-20 浏览次数:20652 次
public String intercept(ActionInvocation invocation) throws Exception { // TODO Auto-generated method stub System.out.println("----------经过了拦截器---------------"); ActionContext act = ActionContext.getContext(); Cuserinfo uinfo = (Cuserinfo)act.getSession().get("user"); if(uinfo == null){ System.out.println("回话过时,请重新登录"); act.put("message", "回话过时,请重新登录."); return "forward"; }else{ return invocation.invoke(); } }
<global-results> <result name="forward">/forward.jsp</result> </global-results>