Re: ServletException: Exceeded maximum depth for nested request dispatches: 20

Splash Forums PrettyFaces Users ServletException: Exceeded maximum depth for nested request dispatches: 20 Re: ServletException: Exceeded maximum depth for nested request dispatches: 20

#23353

jllado
Participant

Thank you for replies!

I have no <j:forward> or <j:include>. I use only Facelet for my view.

I did not have this problem before because I used *.xhtml mapping for FacesServlet.

As soon as I changed FacesServlet mapping to *.jsf this error occurred.

Very important is that I have this error NOT when I type in browser

http://localhost:/projectName/mypage.xhtml

but when I type :

http://localhost:/projectName/mypage.jsf

Second path means that the url is intercepted by FacesServlet and appropriate view is constructed.

Exactly this second url causes the error .

javax.servlet.ServletException: PWC1232: Exceeded maximum depth for nested request dispatches: 20

Before the error arises I see my phase listener goes many times through lifecycle because I log each phase!

Probably FacesServlet redirects my page with url that ends by .jsf and thus FacesServlet again intercepts url which was sent by FacesServlet. Probably it does not change mypage.jsf to mypage.xhtml.

This causes the lifecycle to run 20 times.

Probably the error not due to PrettyFaces but due to FacesServlet.

Please tell me what can I do here?

P.S. I have this error also when I type ‘http://localhost:8080/projectName/’

pretty-config.xml does not have pattern ‘/’ to intercept this url.

Thank you!