struts2 过滤器的意思为什么在web.xml加上以下代码后.index.jsp欢迎页都报404错误了?\x05struts2\x05\x05\x05org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter\x05\x05struts2\x05/*

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/07 06:22:49

struts2 过滤器的意思为什么在web.xml加上以下代码后.index.jsp欢迎页都报404错误了?\x05struts2\x05\x05\x05org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter\x05\x05struts2\x05/*
struts2 过滤器的意思
为什么在web.xml加上以下代码后.index.jsp欢迎页都报404错误了?
\x05struts2
\x05
\x05\x05org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
\x05
\x05struts2
\x05/*

struts2 过滤器的意思为什么在web.xml加上以下代码后.index.jsp欢迎页都报404错误了?\x05struts2\x05\x05\x05org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter\x05\x05struts2\x05/*
你得报错信息是什么啊.你导入struts2的包了么

struts2写拦截器吧?过滤器貌似servlet里边用.
public class LoginInterceptor extends AbstractInterceptor{
private static final long serialVersionUID = 1L;
@Override
public String intercept(ActionInvoca...

全部展开

struts2写拦截器吧?过滤器貌似servlet里边用.
public class LoginInterceptor extends AbstractInterceptor{
private static final long serialVersionUID = 1L;
@Override
public String intercept(ActionInvocation invocation) throws Exception {
Map session=ActionContext.getContext().getSession();
User user=(User) session.get("user");
//如果确认订单时没有登录返回登录页否则继续执行
if (user==null) {
return "relogin";
}else{
invocation.invoke();
return "";
}
}
}
这样可以么?

收起