struts2用action拦截器做权限判断,继承了com.opensymphony.xwork2.interceptor.MethodFilterInterceptor但方法 protected String doIntercept(ActionInvocation invocation)里只能用一次invocation.invoke(),并且要是写在最上面,下面的return 都会不起作用,我试过在最前面加if(invocation.invoke()==null){return "ajax请求";},可是后面的return就无效了,求各位高手怎么解决?
String requestType = req.getHeader("X-Requested-With");
if (requestType != null && requestType.equals("XMLHttpRequest")) {
return true;
} else {
return false;
}