Using PrettyFaces 3.3.1-SNAPSHOT

Splash Forums PrettyFaces Users Using PrettyFaces 3.3.1-SNAPSHOT

This topic contains 2 replies, has 3 voices, and was last updated by  Lincoln Baxter III 10 years, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18045

    mika
    Participant

    hi

    i downloaded the 3.3.1-SNAPSHOT version to make generic url

    regarding this post:

    http://stackoverflow.com/questions/7026232/pretty-faces-generic-url-mapping

    my configuration is as follows:

    my web.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    <display-name>myapp</display-name>

    <listener>
    <listener-class>
    org.springframework.web.context.ContextLoaderListener
    </listener-class>
    </listener>

    <listener>
    <listener-class>
    org.springframework.web.context.request.RequestContextListener
    </listener-class>
    </listener>

    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
    classpath:META-INF/spring/applicationContext.xml
    classpath:META-INF/spring/applicationSecurity.xml
    </param-value>

    </context-param>

    <!-- Activating the Expression Language -->
    <context-param>
    <param-name>com.sun.faces.expressionFactory</param-name>
    <param-value>com.sun.el.ExpressionFactoryImpl</param-value>
    </context-param>

    <context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
    </context-param>

    <welcome-file-list>
    <welcome-file>users</welcome-file>
    </welcome-file-list>

    <context-param>
    <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>

    <context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
    <param-value>resources.application</param-value>
    </context-param>

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

    <context-param>
    <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
    <param-value>true</param-value>
    </context-param>

    <!-- Spring Security -->
    <filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>
    org.springframework.web.filter.DelegatingFilterProxy
    </filter-class>
    </filter>

    <filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</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>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>ERROR</dispatcher>
    </filter-mapping>

    <servlet>
    <servlet-name>Resource Servlet</servlet-name>
    <servlet-class>com.icesoft.faces.webapp.CompatResourceServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
    <servlet-name>Resource Servlet</servlet-name>
    <url-pattern>/xmlhttp/*</url-pattern>
    </servlet-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>/faces/*</url-pattern>
    <url-pattern>/icefaces/*</url-pattern>
    </servlet-mapping>

    </web-app>

    my pretty-config.xml:

    <pretty-config xmlns="http://ocpsoft.com/prettyfaces/3.3.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://ocpsoft.com/prettyfaces/3.3.0
    http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.3.0.xsd">

    <url-mapping id="generic">
    <pattern value="/*" />
    <view-id value="/faces/$1.xhtml" />
    </url-mapping>

    </pretty-config>

    the following line keeps repeating in terminal:

    `at com.ocpsoft.pretty.faces.config.annotation.WebClassesFinder.processDirectory(WebClassesFinder.java:183)

    at`

    #21479

    What do you mean with “repeating in terminal”? This seems to be only a small part of a stacktrace! Can you post the complete stacktrace?

    #21480

    I’m willing to bet that the reason this is “repeating” is because the pattern you have defined: “/*” is actually not valid. This effectively translates to: “/////////..” for any number of repetitions.

    Your view-ID is also invalid, this type of functionality is not available in PrettyFaces yet. The “$1” characters will be interpreted literally as a $1, not as the value that was matched by the pattern. Even if that were the case, you would have needed to use “(…)” in your pattern to specify a regex matching group :)

    So, that being said, it seems like you are trying to do something that is not supported yet by PrettyFaces 3.x (but is supported by Rewrite / PrettyFaces 4.x, which are in beta)

    See my post here:

    http://ocpsoft.com/support/topic/generic-url-mapping

Viewing 3 posts - 1 through 3 (of 3 total)

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.