Re: PrettyFaces in EAR Applications

Splash Forums PrettyFaces Users PrettyFaces in EAR Applications Re: PrettyFaces in EAR Applications

#19869

rafaeltc
Participant

I’ve created new (simple) projects, and did not get this problem.

Now I’m sure it is a configuration issue. But I do not know what configuration setting is causing the problem.

WEB.XML of the application that does not uses pretty-faces ===============

<?xml version=”1.0″ encoding=”UTF-8″?>

<web-app version=”2.5″ 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_2_5.xsd“>

<display-name>Application1</display-name>

<context-param>

<param-name>javax.faces.DEFAULT_SUFFIX</param-name>

<param-value>.xhtml</param-value>

</context-param>

<context-param>

<param-name>facelets.SKIP_COMMENTS</param-name>

<param-value>true</param-value>

</context-param>

<context-param>

<param-name>facelets.REFRESH_PERIOD</param-name>

<param-value>2</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>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>

<param-value>80</param-value>

</context-param>

<context-param>

<param-name>facelets.DEVELOPMENT</param-name>

<param-value>true</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>com.sun.faces.verifyObjects</param-name>

<param-value>true</param-value>

</context-param>

<context-param>

<param-name>com.sun.faces.expressionFactory</param-name>

<param-value>org.jboss.el.ExpressionFactoryImpl</param-value>

</context-param>

<context-param>

<param-name>org.richfaces.SKIN</param-name>

<param-value>blueSky</param-value>

</context-param>

<context-param>

<param-name>org.richfaces.CONTROL_SKINNING</param-name>

<param-value>disable</param-value>

</context-param>

<context-param>

<param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>

<param-value>enable</param-value>

</context-param>

<context-param>

<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>

<param-value>true</param-value>

</context-param>

<context-param>

<param-name>org.ajax4jsf.COMPRESS_STYLE</param-name>

<param-value>true</param-value>

</context-param>

<context-param>

<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>

<param-value>com.sun.facelets.FaceletViewHandler</param-value>

</context-param>

<filter>

<display-name>RichFaces Filter</display-name>

<filter-name>richfaces</filter-name>

<filter-class>org.ajax4jsf.Filter</filter-class>

<init-param>

<param-name>createTempFiles</param-name>

<param-value>true</param-value>

</init-param>

<init-param>

<param-name>maxRequestSize</param-name>

<param-value>1999999999</param-value>

</init-param>

</filter>

<filter>

<filter-name>ExtensionsFilter</filter-name>

<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>

<init-param>

<param-name>uploadMaxFileSize</param-name>

<param-value>10m</param-value>

</init-param>

<init-param>

<param-name>uploadThresholdSize</param-name>

<param-value>100k</param-value>

</init-param>

</filter>

<filter>

<filter-name>SessionTimeoutFilter</filter-name>

<filter-class>br.com.filter.SessionTimeoutFilter</filter-class>

</filter>

<!– Pretty Filter is here just because it asked for it –>

<filter>

<filter-name>Pretty Filter</filter-name>

<filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>

</filter>

<filter-mapping>

<filter-name>Pretty Filter</filter-name>

<url-pattern>/*</url-pattern>

<dispatcher>REQUEST</dispatcher>

<dispatcher>FORWARD</dispatcher>

<dispatcher>ERROR</dispatcher>

</filter-mapping>

<filter-mapping>

<filter-name>richfaces</filter-name>

<servlet-name>Faces Servlet</servlet-name>

<dispatcher>REQUEST</dispatcher>

<dispatcher>FORWARD</dispatcher>

<dispatcher>INCLUDE</dispatcher>

</filter-mapping>

<filter-mapping>

<filter-name>ExtensionsFilter</filter-name>

<servlet-name>Faces Servlet</servlet-name>

</filter-mapping>

<filter-mapping>

<filter-name>ExtensionsFilter</filter-name>

<servlet-name>*.jsf</servlet-name>

</filter-mapping>

<filter-mapping>

<filter-name>SessionTimeoutFilter</filter-name>

<url-pattern>*.jsf</url-pattern>

</filter-mapping>

<listener>

<listener-class>com.sun.faces.config.ConfigureListener</listener-class>

</listener>

<listener>

<listener-class>br.com.listener.ContextListener</listener-class>

</listener>

<listener>

<listener-class>br.com.listener.SessionListener</listener-class>

</listener>

<servlet>

<servlet-name>Faces Servlet</servlet-name>

<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

<load-on-startup>1</load-on-startup>

</servlet>

<servlet>

<display-name>PlayerServlet</display-name>

<servlet-name>PlayerServlet</servlet-name>

<servlet-class>br.com.servlet.PlayerServlet</servlet-class>

</servlet>

<servlet>

<display-name>FeedWriterServlet</display-name>

<servlet-name>FeedWriterServlet</servlet-name>

<servlet-class>br.com.servlet.FeedWriterServlet</servlet-class>

</servlet>

<servlet>

<display-name>ThumbServlet</display-name>

<servlet-name>ThumbServlet</servlet-name>

<servlet-class>br.com.servlet.ThumbServlet</servlet-class>

</servlet>

<servlet>

<display-name>ContentViewServlet</display-name>

<servlet-name>ContentViewServlet</servlet-name>

<servlet-class>br.com.servlet.ContentViewServlet</servlet-class>

</servlet>

<servlet>

<display-name>HelpServlet</display-name>

<servlet-name>HelpServlet</servlet-name>

<servlet-class>br.com.HelpServlet</servlet-class>

</servlet>

<servlet>

<display-name>DownloadServlet</display-name>

<servlet-name>DownloadServlet</servlet-name>

<servlet-class>br.com.servlet.DownloadServlet</servlet-class>

</servlet>

<servlet>

<display-name>UploaderServlet</display-name>

<servlet-name>UploaderServlet</servlet-name>

<servlet-class>br.com.servlet.UploaderServlet</servlet-class>

</servlet>

<servlet>

<servlet-name>UserService</servlet-name>

<servlet-class>br.com.services.UserService</servlet-class>

</servlet>

<servlet>

<servlet-name>DisplayUsers</servlet-name>

<servlet-class>br.com.services.DisplayUsers</servlet-class>

</servlet>

<servlet>

<servlet-name>ErroServlet</servlet-name>

<servlet-class>br.com.servlet.ErroServlet</servlet-class>

</servlet>

<servlet>

<display-name>multipleUploaderServlet</display-name>

<servlet-name>multipleUploaderServlet</servlet-name>

<servlet-class>br.com.servlet.MultipleUploaderServlet</servlet-class>

</servlet>

<servlet>

<display-name>ExportServlet</display-name>

<servlet-name>ExportServlet</servlet-name>

<servlet-class>br.com.servlet.ExportServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>Faces Servlet</servlet-name>

<url-pattern>*.jsf</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>PlayerServlet</servlet-name>

<url-pattern>/player</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>FeedWriterServlet</servlet-name>

<url-pattern>/feed</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>ThumbServlet</servlet-name>

<url-pattern>/thumb</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>ContentViewServlet</servlet-name>

<url-pattern>/content</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>DownloadServlet</servlet-name>

<url-pattern>/download</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>UploaderServlet</servlet-name>

<url-pattern>/UploaderServlet</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>HelpServlet</servlet-name>

<url-pattern>/help</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>UserService</servlet-name>

<url-pattern>/UserService/*</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>DisplayUsers</servlet-name>

<url-pattern>/DisplayUsers/*</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>ErroServlet</servlet-name>

<url-pattern>/erro</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>multipleUploaderServlet</servlet-name>

<url-pattern>/multipleUploaderServlet</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>ExportServlet</servlet-name>

<url-pattern>/export</url-pattern>

</servlet-mapping>

<session-config>

<session-timeout>30</session-timeout>

</session-config>

<error-page>

<exception-type>javax.faces.application.ViewExpiredException</exception-type>

<location>/erro?cod=1</location>

</error-page>

<error-page>

<error-code>500</error-code>

<location>/erro?cod=500</location>

</error-page>

<error-page>

<exception-type>java.lang.SecurityException</exception-type>

<location>/login.jsf</location>

</error-page>

<error-page>

<exception-type>br.com.accesscontrol.PermissionException</exception-type>

<location>/erro?cod=2</location>

</error-page>

<error-page>

<exception-type>java.lang.NullPointerException</exception-type>

<location>/erro?cod=500</location>

</error-page>

<security-constraint>

<web-resource-collection>

<web-resource-name>Proteger Paginas XHTML</web-resource-name>

<url-pattern>*.xhtml</url-pattern>

<http-method>POST</http-method>

</web-resource-collection>

<auth-constraint>

<role-name>developer</role-name>

</auth-constraint>

<user-data-constraint>

<description>SSL required</description>

<transport-guarantee>CONFIDENTIAL</transport-guarantee>

</user-data-constraint>

</security-constraint>

<login-config>

<auth-method>BASIC</auth-method>

</login-config>

<security-role>

<role-name>developer</role-name>

</security-role>

</web-app>

WEB.XML of the application which uses the pretty faces ==========

<?xml version=”1.0″?>

<web-app version=”2.5″ 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_2_5.xsd“>

<display-name>app2</display-name>

<context-param>

<param-name>javax.faces.DEFAULT_SUFFIX</param-name>

<param-value>.xhtml</param-value>

</context-param>

<context-param>

<param-name>org.richfaces.SKIN</param-name>

<param-value>blueSky</param-value>

</context-param>

<context-param>

<param-name>org.richfaces.CONTROL_SKINNING</param-name>

<param-value>enable</param-value>

</context-param>

<context-param>

<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>

<param-value>true</param-value>

</context-param>

<context-param>

<param-name>org.ajax4jsf.COMPRESS_STYLE</param-name>

<param-value>true</param-value>

</context-param>

<context-param>

<param-name>facelets.DEVELOPMENT</param-name>

<param-value>true</param-value>

</context-param>

<filter>

<display-name>Ajax4jsf Filter</display-name>

<filter-name>ajax4jsf</filter-name>

<filter-class>org.ajax4jsf.Filter</filter-class>

<init-param>

<param-name>createTempFiles</param-name>

<param-value>true</param-value>

</init-param>

<init-param>

<param-name>maxRequestSize</param-name>

<param-value>2147483647</param-value>

</init-param>

</filter>

<filter-mapping>

<filter-name>ajax4jsf</filter-name>

<servlet-name>Faces Servlet</servlet-name>

<dispatcher>REQUEST</dispatcher>

<dispatcher>FORWARD</dispatcher>

<dispatcher>INCLUDE</dispatcher>

<dispatcher>ERROR</dispatcher>

</filter-mapping>

<filter>

<filter-name>Pretty Filter</filter-name>

<filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>

</filter>

<filter-mapping>

<filter-name>Pretty Filter</filter-name>

<url-pattern>/*</url-pattern>

<dispatcher>REQUEST</dispatcher>

<dispatcher>FORWARD</dispatcher>

<dispatcher>ERROR</dispatcher>

</filter-mapping>

<listener>

<listener-class>br.com.app2.listener.SessionListener</listener-class>

</listener>

<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>

</session-config>

<welcome-file-list>

<welcome-file>/</welcome-file>

</welcome-file-list>

<error-page>

<error-code>404</error-code>

<location>/404.jsf</location>

</error-page>

<security-constraint>

<web-resource-collection>

<web-resource-name>Proteger Paginas XHTML</web-resource-name>

<url-pattern>*.xhtml</url-pattern>

<http-method>POST</http-method>

</web-resource-collection>

<auth-constraint>

<role-name>developer</role-name>

</auth-constraint>

<user-data-constraint>

<description>SSL required</description>

<transport-guarantee>CONFIDENTIAL</transport-guarantee>

</user-data-constraint>

</security-constraint>

<login-config>

<auth-method>BASIC</auth-method>

</login-config>

<security-role>

<role-name>developer</role-name>

</security-role>

</web-app>