infinite loop

Splash Forums PrettyFaces Users infinite loop

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

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #17930

    kellerapps
    Participant

    prettyfaces 3.2.1

    mojarra

    I’m trying to map a URL like:

    http://domain/login/t

    <url-mapping id=”login”>

    <pattern value=”/login/#{ token }”/>

    <view-id>login.jsf</view-id>

    </url-mapping>

    results in an infinite loop. Part of the stack trace is appended to this post.

    When I add a trailing slash to the URL & the mapping:

    <url-mapping id=”login”>

    <pattern value=”/login/#{ token }/”/>

    <view-id>login.jsf</view-id>

    </url-mapping>

    the viewId is incorrect:

    login/t/login.jsf

    Then I tried:

    http://domain/login.jsf?token=t

    I tried capturing the req param with:

    <f:metadata>

    <f:viewParam id=”token” name=”token” required=”true” value=”#{auth.token}”/>

    </f:metadata>

    However, auth.setToken() is never invoked.

    Help is appreciated.

    at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:284)

    at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:284)

    at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:70)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)

    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)

    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)

    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)

    at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:110)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)

    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)

    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)

    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)

    at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:110)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)

    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)

    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)

    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)

    at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:110)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)

    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)

    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)

    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)

    #20944

    I think youj need a leading slash on the view-id

    #20945

    kellerapps
    Participant

    That got rid of the loop–thx!

    Any idea on the view param not calling the setter?

    Does prettyfaces rewrite:

    ExternalContext.redirect()

    or:

    FacesContext.getApplication().getNavigationHandler().handleNavigation ?

    #20946

    Yes, prettyfaces should be rewriting URLs passed into those methods.

    I’m not sure why the view param wouldn’t be working. I know there is an issue with GlassFish that breaks ViewParams that we are aware of already: http://code.google.com/p/prettyfaces/issues/detail?id=92

    If you are not using GlassFish, could you please post some information on your environment? And possibly attach a sample app to the issue that reproduces this problem?

    Thanks,

    Lincoln

    #20947

    You could use PrettyFaces injection instead; note the updated pattern:

    <url-mapping id="login">
    <pattern value="/login/#{ token : auth.token }/"/>
    <view-id>login.jsf</view-id>
    </url-mapping>

    But that is pretty much just a workaround because what you did should work, it’s just that GlassFish doesn’t work in this case… and they haven’t fixed the bug.

    Have you tried JBoss AS 6 or 7?

    http://www.jboss.org/jbossas/downloads.html

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

You must be logged in to reply to this topic.

Comments are closed.