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

#23354

jllado
Participant

My web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<description>My first real web site where you get help on java</description>
<display-name>JavaHelp web site</display-name>
<distributable/>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.FULL_STATE_SAVING_VIEW_IDS</param-name>
<param-value>/user/userProfile.jsf,/register.jsf</param-value>
</context-param>
<context-param>
<param-name>javax.faces.FACELETS_SUFFIX</param-name>
<param-value>*.jsf</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>*.jsf</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/JavaHelp-taglib.xml</param-value>
</context-param>
<mime-mapping>
<extension>jpeg</extension>
<mime-type>image/jpeg</mime-type>
</mime-mapping>
<mime-mapping>
<extension>png</extension>
<mime-type>image/png</mime-type>
</mime-mapping>
<mime-mapping>
<extension>gif</extension>
<mime-type>image/gif</mime-type>
</mime-mapping>

<filter>
<filter-name>Upload Filter</filter-name>
<filter-class>com.javahelp.util.cc.UploadFilter</filter-class>
<init-param>
<param-name>sizeThreshold</param-name>
<param-value>1024</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Upload Filter</filter-name>
<url-pattern>/register.jsf</url-pattern>
</filter-mapping>

<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
<cookie-config>
<name>SESSIONID</name>
</cookie-config>
</session-config>
<welcome-file-list>
<welcome-file>/index.jsf</welcome-file>
</welcome-file-list>

<login-config>
<auth-method>FORM</auth-method>
<realm-name>javahelpRealm</realm-name>
<form-login-config>
<form-login-page>/WEB-INF/resources/login.jsf</form-login-page>
<form-error-page>/WEB-INF/resources/loginError.jsf</form-error-page>
</form-login-config>
</login-config>
<security-constraint>
<display-name>UserConstraint</display-name>
<web-resource-collection>
<web-resource-name>Secure Pages</web-resource-name>
<description>User area</description>
<url-pattern>/user/*</url-pattern>
<url-pattern>/login</url-pattern>
<url-pattern>/profile</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>USER</role-name>
</auth-constraint>
<user-data-constraint>
<description>highest supported transport security level</description>
<!--<transport-guarantee>CONFIDENTIAL</transport-guarantee>-->
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-constraint>
<display-name>AdminConstraint</display-name>
<web-resource-collection>
<web-resource-name>Secure Pages</web-resource-name>
<description>Administration area</description>
<url-pattern>/admin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>ADMINISTRATOR</role-name>
</auth-constraint>
<user-data-constraint>
<description>highest supported transport security level</description>
<!--<transport-guarantee>CONFIDENTIAL</transport-guarantee>-->
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-role>
<description/>
<role-name>ADMINISTRATOR</role-name>
</security-role>
<security-role>
<description/>
<role-name>USER</role-name>
</security-role>
<env-entry>
<description>Base URL as seen in the user's browser.</description>
<env-entry-name>javahelp/uploadsDir</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>C://glassfish3/glassfish/domains/domain1/lib/JavaHelp/uploads</env-entry-value>
</env-entry>
<env-entry>
<description>Base URL as seen in the user's browser.</description>
<env-entry-name>javahelp/StickerList</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>C://glassfish3/glassfish/domains/domain1/lib/JavaHelp/other/StickerList.list</env-entry-value>
</env-entry>
<error-page>
<error-code>403</error-code>
<location>/WEB-INF/resources/forbidden.jsf</location>
</error-page>
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/index.jsf</location>
</error-page>
<resource-ref>
<description>this references to factory of javax.mail.Session instances</description>
<res-ref-name>mail/javahelpSession</res-ref-name>
<res-type>javax.mail.Session</res-type>
<res-auth>Container</res-auth>
</resource-ref>
<ejb-local-ref>
<ejb-ref-name>mailerBean</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local>com.javahelp.util.MailerBean</local>
</ejb-local-ref>
</web-app>

My pretty-config.xml

<pretty-config xmlns="http://ocpsoft.com/prettyfaces/3.3.3"
xmlns:xsi="http: / www.w3.org / XMLSchema-instance"
xsi:schemaLocation="http://ocpsoft.com/prettyfaces/3.3.3 http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.3.3.xsd">
<rewrite match="/index.xhtml" substitute="/resource_not_found"
redirect="301" />
<rewrite match="/register.xhtml" substitute="/resource_not_found"
redirect="301" />
<rewrite match="/user/userProfile.xhtml" substitute="/resource_not_found"
redirect="301" />
<rewrite match="/forums.xhtml" substitute="/resource_not_found"
redirect="301" />
<rewrite match="/forum.xhtml" substitute="/resource_not_found"
redirect="301" />
<rewrite match="/topic.xhtml" substitute="/resource_not_found"
redirect="301" />

<url-mapping id="home">
<pattern value="/home" />
<view-id value="/index.jsf" />
<action>#{user.notifyUserOfActivation}</action>
</url-mapping>

<url-mapping id="login">
<pattern value="/login" />
<view-id value="/index.jsf" />
<query-param name="currentPage">#{user.currentPage}</query-param>
<action>#{user.redirectLoggedInUser}</action>
</url-mapping>

<url-mapping id="logout">
<pattern value="/guest" />
<view-id value="/index.jsf" />
<action>#{user.logout}</action>
</url-mapping>

<url-mapping id="register" onPostback="false">
<pattern value="/register" />
<view-id value="/register.jsf" />
</url-mapping>

<url-mapping id="newUser">
<pattern value="/welcome" />
<view-id value="/register.jsf" />
<action>#{registerBacking.create}</action>
</url-mapping>

<url-mapping id="profile" onPostback="false">
<pattern value="/profile" />
<view-id value="/user/userProfile.jsf" />
</url-mapping>

<url-mapping id="forums">
<pattern value="/forums" />
<view-id value="/forums.jsf" />
</url-mapping>

<url-mapping id="forum">
<pattern value="/forum.jsf" />
<query-param name="forumId" validator="#{forumBacking.validateUrlParameter}"
onError="pretty:forums">#{forumBacking.currentForum}</query-param>
<view-id value="/forum.jsf" />
<action>#{forumBacking.checkForumIdUrlParameter}</action>
</url-mapping>

<url-mapping id="topic">
<pattern value="/topic.jsf" />
<query-param name="topicId" onPostback="false"
validator="#{user.validateUrlParameter}" onError="pretty:forums">#{topicBacking.currentTopic}</query-param>
<view-id value="/topic.jsf" />
<action>#{topicBacking.checkTopicIdUrlParameter}</action>
</url-mapping>

<url-mapping parentId="forums" id="forumTopic">
<pattern value="/#{forumTopicId}">
<validate index="0" validator="#{requestScopedBean.validateUrlParameters}"
onError="pretty:forums" />
</pattern>
<view-id value="#{requestScopedBean.targetPage}" />
</url-mapping>
</pretty-config>