A whiteboard error occurred while accessing the struts2 action page.
Therefore, you must set the stack to intercept this action,
<Bean id = "authenticationinterceptor" class = "com. COSL. util. Interceptor. authenticationinterceptor"> </bean> <! -- Permission interceptor -->
<? XML version = "1.0" encoding = "UTF-8"?> <! Doctype struts public "-// Apache Software Foundation // DTD struts configuration 2.1 // en" "http://struts.apache.org/dtds/struts-2.1.dtd"> <struts> <package name = "struts-my" extends = "JSON -Default "> <interceptors> <! -- Determine whether to log on and whether to have access permissions --> <interceptor name = "auth" class = "authenticationinterceptor"/> <! -- This is com. COSL. util. interceptor. authenticationinterceptor interceptor in applicationcontext. the XML file is instantiated --> <Interceptor-stack name = "mystack"> <Interceptor-ref name = "auth"> </Interceptor-ref> <Interceptor-ref name =" defaultstack "> </Interceptor-ref> </Interceptor-stack> </interceptors> <default-interceptor-ref name =" mystack "> </default-interceptor-ref> <default-action-ref name = "notfound"/> <global-Results> <result name = "nologin" type = "Redirect">/pages/developer/loginjsp </result> <result name = "nopower" type = "Redirect">/no_power.jsp </result> </Global-Results> <action name = "notfound" class = "com. COSL. util. commonaction "method =" notfound "> <result name =" success ">/not_found.jsp </result> </Action> </package> </struts>
<Package name = "diaocha" extends = "struts-my" namespace = "/pages/diaocha"> <action name = "diaochajsp" class = "com. COSL. action. diaochaaction "method =" diaochajsp "> <Interceptor-ref name =" defaultstack "/> <! -- After debugging for four hours, no result is returned when I directly access the action because interceptor intercepts it. --> <result name = "diaochajsp">/admin/editpasswordjsp. JSP </result> </Action> </package>
That is because the accessed action is intercepted by the following code, and the accessed action is accessed before login, that is, the action accessed in non-login status, intercepted by the following interceptor,
Public class authenticationinterceptor extends actinterceptor {@ override Public String intercept (actioninvocation Invocation) throws exception {// todo auto-generated method stub map = invocation. getinvocationcontext (). getsession (); If (map. get ("user ")! = NULL) {// return "nologin"; return invocation. Invoke () ;}else {// get logon User Permissions} return NULL ;}}
A whiteboard error occurred while accessing the struts2 action page.