DynamicMappingFilter 和许多带有错误页面的嵌套请求

发布于 2025-01-06 22:44:45 字数 18648 浏览 0 评论 0原文

我使用 DynamicMappingFilter 配置了 Stripes,这样我就可以使用不带“*.action”的 URL。我希望 Stripes 处理我的错误页面。我制作了一个简单的 error.jsp 页面,在 web.xml 中引用该页面来处理 404 错误:

<jsp:forward page="/support/Error" />

它正在转发到此,现在几乎为空,Stripes 操作

public class ErrorAction extends BaseAction implements ActionBean {

    @DefaultHandler
    public Resolution action() {
        return new ForwardResolution("/WEB-INF/pages/test.jsp");
    }
}

: >/WEB-INF/pages/test.jsp 是一个纯 HTML Hello World 页面(由 Netbeans 生成)。

但由于某种原因它不起作用。转发到 /WEB-INF/pages/test.jsp 后,再次请求 ErrorAction,并且此循环将继续,直到 GlassFish 停止为止。

这是记录的内容(/fasdfasdfasdf 是一个不存在的 URL):

INFO: 14:37:13,646 TRACE StripesFilter:198 - Intercepting request to URL: /fasdfasdfasdf
INFO: 14:37:13,648 DEBUG UrlBindingFactory:187 - No URL binding matches /fasdfasdfasdf
INFO: 14:37:13,648 DEBUG UrlBindingFactory:187 - No URL binding matches /fasdfasdfasdf

INFO: 14:37:13,650 TRACE StripesFilter:198 - Intercepting request to URL: /support/Error
WARNING: PWC4011: Unable to set request character encoding to UTF-8 from context /mycompany-web-seller, because request parameters have already been read, or ServletRequest.getReader() has already been called
INFO: 14:37:13,652 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,653 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,653 TRACE DispatcherServlet:198 - Dispatching request to URL: /support/Error
INFO: 14:37:13,654 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage RequestInit
INFO: 14:37:13,654 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage ActionBeanResolution
INFO: 14:37:13,654 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,655 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,656 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage HandlerResolution
INFO: 14:37:13,656 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,657 DEBUG DispatcherHelper:187 - Resolved event: action; will invoke: ErrorAction.action()
INFO: 14:37:13,657 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage BindingAndValidation
INFO: 14:37:13,658 DEBUG DefaultActionBeanPropertyBinder:187 - Running required field validation on bean class com.mycompany.stripes.support.ErrorAction
INFO: 14:37:13,658 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage CustomValidation
INFO: 14:37:13,659 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage EventHandling
INFO: 14:37:13,659 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage ResolutionExecution
INFO: 14:37:13,660 DEBUG HttpCacheInterceptor:187 - Looking for HttpCache on com.mycompany.stripes.support.ErrorAction.action()
INFO: 14:37:13,660 DEBUG UrlBindingFactory:187 - No URL binding matches /WEB-INF/pages/test.jsp
INFO: 14:37:13,661 DEBUG UrlBindingFactory:187 - No URL binding matches /WEB-INF/pages/test.jsp
INFO: 14:37:13,662 TRACE ForwardResolution:198 - Forwarding to URL: /WEB-INF/pages/test.jsp

INFO: 14:37:13,667 TRACE StripesFilter:198 - Intercepting request to URL: /support/Error
INFO: 14:37:13,668 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,669 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,670 TRACE DispatcherServlet:198 - Dispatching request to URL: /support/Error
INFO: 14:37:13,670 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage RequestInit
INFO: 14:37:13,671 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage ActionBeanResolution
INFO: 14:37:13,671 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,672 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,673 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage HandlerResolution
INFO: 14:37:13,673 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,674 DEBUG DispatcherHelper:187 - Resolved event: action; will invoke: ErrorAction.action()
INFO: 14:37:13,675 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage BindingAndValidation
INFO: 14:37:13,675 DEBUG DefaultActionBeanPropertyBinder:187 - Running required field validation on bean class com.mycompany.stripes.support.ErrorAction
INFO: 14:37:13,676 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage CustomValidation
INFO: 14:37:13,676 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage EventHandling
INFO: 14:37:13,677 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage ResolutionExecution
INFO: 14:37:13,677 DEBUG HttpCacheInterceptor:187 - Looking for HttpCache on com.mycompany.stripes.support.ErrorAction.action()
INFO: 14:37:13,678 DEBUG UrlBindingFactory:187 - No URL binding matches /WEB-INF/pages/test.jsp
INFO: 14:37:13,679 DEBUG UrlBindingFactory:187 - No URL binding matches /WEB-INF/pages/test.jsp
INFO: 14:37:13,679 TRACE ForwardResolution:198 - Forwarding to URL: /WEB-INF/pages/test.jsp

... and again the same

例外情况是:

WARNING: ApplicationDispatcher[/mycompany-web-seller] PWC1231: Servlet.service() for servlet default threw exception 
javax.servlet.ServletException: PWC1232: Exceeded maximum depth for nested request dispatches: 20                    
  at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:772)                         
  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:649)                           
  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:483)                   
  at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:454)                       
  at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:350)                         

  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:300)                          
  at net.sourceforge.stripes.action.ForwardResolution.execute(ForwardResolution.java:110)                            
  at net.sourceforge.stripes.controller.DispatcherHelper$7.intercept(DispatcherHelper.java:508)                      
  at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:158)                          
  at net.sourceforge.stripes.controller.HttpCacheInterceptor.intercept(HttpCacheInterceptor.java:99)                 
  at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)                          
  at net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:113)
  at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)                          
  at net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:74)                              
  at net.sourceforge.stripes.controller.DispatcherHelper.executeResolution(DispatcherHelper.java:502)                
  at net.sourceforge.stripes.controller.DispatcherServlet.executeResolution(DispatcherServlet.java:286)              
  at net.sourceforge.stripes.controller.DispatcherServlet.service(DispatcherServlet.java:170)                        
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)                                                    
  at net.sourceforge.stripes.controller.DynamicMappingFilter$2.doFilter(DynamicMappingFilter.java:431)               
  at net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:247)                               
  at net.sourceforge.stripes.controller.DynamicMappingFilter.doFilter(DynamicMappingFilter.java:418)                 
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)               
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)                       
  at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:785)                         
  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:649)                           
  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:483)                   
  at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:454)                       
  at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:350)                         
  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:300)                          
  at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:785)                                     
  at org.apache.jsp.error_jsp._jspService(error_jsp.java:48)                                                         
  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)                                             
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)                                                    
  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:403)                                 
  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)                                        
  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)                                               
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)                                                    
  at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)                                     
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)               
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)                       
  at net.sourceforge.stripes.controller.DynamicMappingFilter.doFilter(DynamicMappingFilter.java:397)                 
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)               
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)                       
  at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:785)                         
  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:649)                           
  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:485)                   
  at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:454)                       
  at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:350)                         
  at org.apache.catalina.core.ApplicationDispatcherForward.custom(ApplicationDispatcherForward.java:253)             
  at org.apache.catalina.core.ApplicationDispatcherForward.status(ApplicationDispatcherForward.java:209)             
  at org.apache.catalina.core.ApplicationDispatcherForward.commit(ApplicationDispatcherForward.java:131)             
  at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:353)                         

  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:300)                          
  at net.sourceforge.stripes.action.ForwardResolution.execute(ForwardResolution.java:110)                            
  at net.sourceforge.stripes.controller.DispatcherHelper$7.intercept(DispatcherHelper.java:508)                      
  at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:158)                          
  at net.sourceforge.stripes.controller.HttpCacheInterceptor.intercept(HttpCacheInterceptor.java:99)                 
  at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)                          
  at net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:113)
  at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)                          
  at net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:74)                              
  at net.sourceforge.stripes.controller.DispatcherHelper.executeResolution(DispatcherHelper.java:502)                
  at net.sourceforge.stripes.controller.DispatcherServlet.executeResolution(DispatcherServlet.java:286)              
  at net.sourceforge.stripes.controller.DispatcherServlet.service(DispatcherServlet.java:170)                        
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)                                                    
  at net.sourceforge.stripes.controller.DynamicMappingFilter$2.doFilter(DynamicMappingFilter.java:431)               
  at net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:247)                               
  at net.sourceforge.stripes.controller.DynamicMappingFilter.doFilter(DynamicMappingFilter.java:418)                 
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)               
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)                       
  at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:785)                         
  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:649)                           
  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:483)                   
  at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:454)                       
  at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:350)                         
  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:300)                          
  at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:785)                                     
  at org.apache.jsp.error_jsp._jspService(error_jsp.java:48)                                                         
  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)                                             
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)                                                    
  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:403)                                 
  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)                                        
  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)                                               
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)                                                    
  at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)                                     
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)               
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)                       
  at net.sourceforge.stripes.controller.DynamicMappingFilter.doFilter(DynamicMappingFilter.java:397)                 
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)               
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)                       
  at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:785)                         
  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:649)                           
  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:485)                   
  at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:454)                       
  at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:350)                         
  at org.apache.catalina.core.ApplicationDispatcherForward.custom(ApplicationDispatcherForward.java:253)             
  at org.apache.catalina.core.ApplicationDispatcherForward.status(ApplicationDispatcherForward.java:209)             
  at org.apache.catalina.core.ApplicationDispatcherForward.commit(ApplicationDispatcherForward.java:131)             
  at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:353)          
  ... and again the same

部分:

-> /badurl
   -> DynamicMappingFilter
      -> chain.doFilter
      <- 404
      * no Stripes ActionBean found for /badurl
   <-
-> error.jsp
   -> DynamicMappingFilter
      -> chain.doFilter
         -> error.jsp
            -> /support/Error
               -> DynamicMappingFilter
                  -> chain.doFilter
                  <- 404
                  * ErrorAction found
                  -> stripesDispatcher.service
                     -> ForwardResolution.execute (/WEB-INF/pages/test.jsp)
                        -> DynamicMappingFilter
                           -> chain.doFilter
                              -> /WEB-INF/pages/test.jsp
                              <-
                           <- OK
                        <-
                        ? it does not return to ForwardResolution.execute
                        -> DynamicMappingFilter
                           -> chain.doFilter
                              -> error.jsp
                               and the loop starts again

这是在调试器中跟踪时请求的执行方式(仅认为重要的 有人知道为什么转发到 test.jsp 后有对 /error.jsp 的请求吗? /support/Error 按预期工作 - /WEB-INF/pages/test.jsp 已呈现并且请求已完成

:如果 error.jsp<。 /code> 直接转发到 /WEB-INF/pages/test 不会有任何循环,只是当它执行 Stripes 操作时才会发生。

I configured Stripes with the DynamicMappingFilter so I can use URL without "*.action". I want Stripes to handle my error pages. I made a simple error.jsp page which I referenced in web.xml to handle 404 errors:

<jsp:forward page="/support/Error" />

It is forwarding to this, now almost empty, Stripes action:

public class ErrorAction extends BaseAction implements ActionBean {

    @DefaultHandler
    public Resolution action() {
        return new ForwardResolution("/WEB-INF/pages/test.jsp");
    }
}

The /WEB-INF/pages/test.jsp is a plain HTML Hello World page (generated by Netbeans).

But for some reason it doesn't work. After forwarding to /WEB-INF/pages/test.jsp ErrorAction is requested again and this loop continues until GlassFish stops it.

This is what gets logged (/fasdfasdfasdf is a URL which does not exist):

INFO: 14:37:13,646 TRACE StripesFilter:198 - Intercepting request to URL: /fasdfasdfasdf
INFO: 14:37:13,648 DEBUG UrlBindingFactory:187 - No URL binding matches /fasdfasdfasdf
INFO: 14:37:13,648 DEBUG UrlBindingFactory:187 - No URL binding matches /fasdfasdfasdf

INFO: 14:37:13,650 TRACE StripesFilter:198 - Intercepting request to URL: /support/Error
WARNING: PWC4011: Unable to set request character encoding to UTF-8 from context /mycompany-web-seller, because request parameters have already been read, or ServletRequest.getReader() has already been called
INFO: 14:37:13,652 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,653 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,653 TRACE DispatcherServlet:198 - Dispatching request to URL: /support/Error
INFO: 14:37:13,654 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage RequestInit
INFO: 14:37:13,654 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage ActionBeanResolution
INFO: 14:37:13,654 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,655 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,656 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage HandlerResolution
INFO: 14:37:13,656 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,657 DEBUG DispatcherHelper:187 - Resolved event: action; will invoke: ErrorAction.action()
INFO: 14:37:13,657 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage BindingAndValidation
INFO: 14:37:13,658 DEBUG DefaultActionBeanPropertyBinder:187 - Running required field validation on bean class com.mycompany.stripes.support.ErrorAction
INFO: 14:37:13,658 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage CustomValidation
INFO: 14:37:13,659 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage EventHandling
INFO: 14:37:13,659 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage ResolutionExecution
INFO: 14:37:13,660 DEBUG HttpCacheInterceptor:187 - Looking for HttpCache on com.mycompany.stripes.support.ErrorAction.action()
INFO: 14:37:13,660 DEBUG UrlBindingFactory:187 - No URL binding matches /WEB-INF/pages/test.jsp
INFO: 14:37:13,661 DEBUG UrlBindingFactory:187 - No URL binding matches /WEB-INF/pages/test.jsp
INFO: 14:37:13,662 TRACE ForwardResolution:198 - Forwarding to URL: /WEB-INF/pages/test.jsp

INFO: 14:37:13,667 TRACE StripesFilter:198 - Intercepting request to URL: /support/Error
INFO: 14:37:13,668 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,669 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,670 TRACE DispatcherServlet:198 - Dispatching request to URL: /support/Error
INFO: 14:37:13,670 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage RequestInit
INFO: 14:37:13,671 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage ActionBeanResolution
INFO: 14:37:13,671 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,672 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,673 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage HandlerResolution
INFO: 14:37:13,673 DEBUG UrlBindingFactory:187 - Matched /support/Error to /support/Error
INFO: 14:37:13,674 DEBUG DispatcherHelper:187 - Resolved event: action; will invoke: ErrorAction.action()
INFO: 14:37:13,675 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage BindingAndValidation
INFO: 14:37:13,675 DEBUG DefaultActionBeanPropertyBinder:187 - Running required field validation on bean class com.mycompany.stripes.support.ErrorAction
INFO: 14:37:13,676 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage CustomValidation
INFO: 14:37:13,676 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage EventHandling
INFO: 14:37:13,677 DEBUG ExecutionContext:187 - Transitioning to lifecycle stage ResolutionExecution
INFO: 14:37:13,677 DEBUG HttpCacheInterceptor:187 - Looking for HttpCache on com.mycompany.stripes.support.ErrorAction.action()
INFO: 14:37:13,678 DEBUG UrlBindingFactory:187 - No URL binding matches /WEB-INF/pages/test.jsp
INFO: 14:37:13,679 DEBUG UrlBindingFactory:187 - No URL binding matches /WEB-INF/pages/test.jsp
INFO: 14:37:13,679 TRACE ForwardResolution:198 - Forwarding to URL: /WEB-INF/pages/test.jsp

... and again the same

And the exception is:

WARNING: ApplicationDispatcher[/mycompany-web-seller] PWC1231: Servlet.service() for servlet default threw exception 
javax.servlet.ServletException: PWC1232: Exceeded maximum depth for nested request dispatches: 20                    
  at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:772)                         
  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:649)                           
  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:483)                   
  at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:454)                       
  at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:350)                         

  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:300)                          
  at net.sourceforge.stripes.action.ForwardResolution.execute(ForwardResolution.java:110)                            
  at net.sourceforge.stripes.controller.DispatcherHelper$7.intercept(DispatcherHelper.java:508)                      
  at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:158)                          
  at net.sourceforge.stripes.controller.HttpCacheInterceptor.intercept(HttpCacheInterceptor.java:99)                 
  at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)                          
  at net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:113)
  at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)                          
  at net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:74)                              
  at net.sourceforge.stripes.controller.DispatcherHelper.executeResolution(DispatcherHelper.java:502)                
  at net.sourceforge.stripes.controller.DispatcherServlet.executeResolution(DispatcherServlet.java:286)              
  at net.sourceforge.stripes.controller.DispatcherServlet.service(DispatcherServlet.java:170)                        
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)                                                    
  at net.sourceforge.stripes.controller.DynamicMappingFilter$2.doFilter(DynamicMappingFilter.java:431)               
  at net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:247)                               
  at net.sourceforge.stripes.controller.DynamicMappingFilter.doFilter(DynamicMappingFilter.java:418)                 
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)               
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)                       
  at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:785)                         
  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:649)                           
  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:483)                   
  at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:454)                       
  at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:350)                         
  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:300)                          
  at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:785)                                     
  at org.apache.jsp.error_jsp._jspService(error_jsp.java:48)                                                         
  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)                                             
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)                                                    
  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:403)                                 
  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)                                        
  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)                                               
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)                                                    
  at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)                                     
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)               
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)                       
  at net.sourceforge.stripes.controller.DynamicMappingFilter.doFilter(DynamicMappingFilter.java:397)                 
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)               
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)                       
  at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:785)                         
  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:649)                           
  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:485)                   
  at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:454)                       
  at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:350)                         
  at org.apache.catalina.core.ApplicationDispatcherForward.custom(ApplicationDispatcherForward.java:253)             
  at org.apache.catalina.core.ApplicationDispatcherForward.status(ApplicationDispatcherForward.java:209)             
  at org.apache.catalina.core.ApplicationDispatcherForward.commit(ApplicationDispatcherForward.java:131)             
  at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:353)                         

  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:300)                          
  at net.sourceforge.stripes.action.ForwardResolution.execute(ForwardResolution.java:110)                            
  at net.sourceforge.stripes.controller.DispatcherHelper$7.intercept(DispatcherHelper.java:508)                      
  at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:158)                          
  at net.sourceforge.stripes.controller.HttpCacheInterceptor.intercept(HttpCacheInterceptor.java:99)                 
  at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)                          
  at net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:113)
  at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)                          
  at net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:74)                              
  at net.sourceforge.stripes.controller.DispatcherHelper.executeResolution(DispatcherHelper.java:502)                
  at net.sourceforge.stripes.controller.DispatcherServlet.executeResolution(DispatcherServlet.java:286)              
  at net.sourceforge.stripes.controller.DispatcherServlet.service(DispatcherServlet.java:170)                        
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)                                                    
  at net.sourceforge.stripes.controller.DynamicMappingFilter$2.doFilter(DynamicMappingFilter.java:431)               
  at net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:247)                               
  at net.sourceforge.stripes.controller.DynamicMappingFilter.doFilter(DynamicMappingFilter.java:418)                 
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)               
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)                       
  at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:785)                         
  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:649)                           
  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:483)                   
  at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:454)                       
  at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:350)                         
  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:300)                          
  at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:785)                                     
  at org.apache.jsp.error_jsp._jspService(error_jsp.java:48)                                                         
  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)                                             
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)                                                    
  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:403)                                 
  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:492)                                        
  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:378)                                               
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)                                                    
  at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)                                     
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)               
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)                       
  at net.sourceforge.stripes.controller.DynamicMappingFilter.doFilter(DynamicMappingFilter.java:397)                 
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)               
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)                       
  at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:785)                         
  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:649)                           
  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:485)                   
  at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:454)                       
  at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:350)                         
  at org.apache.catalina.core.ApplicationDispatcherForward.custom(ApplicationDispatcherForward.java:253)             
  at org.apache.catalina.core.ApplicationDispatcherForward.status(ApplicationDispatcherForward.java:209)             
  at org.apache.catalina.core.ApplicationDispatcherForward.commit(ApplicationDispatcherForward.java:131)             
  at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:353)          
  ... and again the same

Here's how the request is executed when tracing in the debugger (only the parts are think are important:

-> /badurl
   -> DynamicMappingFilter
      -> chain.doFilter
      <- 404
      * no Stripes ActionBean found for /badurl
   <-
-> error.jsp
   -> DynamicMappingFilter
      -> chain.doFilter
         -> error.jsp
            -> /support/Error
               -> DynamicMappingFilter
                  -> chain.doFilter
                  <- 404
                  * ErrorAction found
                  -> stripesDispatcher.service
                     -> ForwardResolution.execute (/WEB-INF/pages/test.jsp)
                        -> DynamicMappingFilter
                           -> chain.doFilter
                              -> /WEB-INF/pages/test.jsp
                              <-
                           <- OK
                        <-
                        ? it does not return to ForwardResolution.execute
                        -> DynamicMappingFilter
                           -> chain.doFilter
                              -> error.jsp
                               and the loop starts again

Does anyone know why after forwarding to the test.jsp there are requests for /error.jsp? Requesting /error.jsp, /support/Error works as expected - /WEB-INF/pages/test.jsp is rendered and the request is completed.

EDIT: If error.jsp forwards directly to /WEB-INF/pages/test there won't be any loop. It's just when it goes through the Stripes action when it happens.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青丝拂面 2025-01-13 22:44:45

我认为您的“/WEB-INF/pages/test.jsp”在该 URL 中不存在,这会导致 404 错误,该错误会重新启动整个过程,从而导致无限循环。

您可以直接访问“/WEB-INF/pages/test.jsp”页面吗?

I think your "/WEB-INF/pages/test.jsp" does not exists at that URL, this is causing the 404 error which starts the whole thing over again, thus causing the infinite loop.

Can you access the page "/WEB-INF/pages/test.jsp" directly without any problems?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文