Re: http://domain.com/{username} Short URLs or catchall (Facebook-style)

Splash Forums PrettyFaces Users http://domain.com/{username} Short URLs or catchall (Facebook-style) Re: http://domain.com/{username} Short URLs or catchall (Facebook-style)

#21954

ceefour
Participant

@lincoln, This is the non-working entire pretty-config as you requested: http://pastebin.com/2Xv3c0G8

When I access, say /hendy.irawan, it goes into infinite loop like this:

at org.apache.catalina.core.ApplicationHttpRequest.setAttribute(ApplicationHttpRequest.java:303) [jbossweb-7.0.7.Final.jar:]

at org.apache.catalina.core.ApplicationHttpRequest.setAttribute(ApplicationHttpRequest.java:303) [jbossweb-7.0.7.Final.jar:]

All I need to fix is change the pattern here:

<url-mapping id=”slug”>

<pattern value=”/#{ slug : slugBean.slug }”>

<validate index=”0″ validator=”#{slugBean.validateSlug}”/>

</pattern>

<view-id value=”#{slugBean.getViewPath}” />

</url-mapping>

to here:

<pattern value=”/slug/#{ slug : slugBean.slug }”>

Now I can access both:

* /people/hendy.irawan

* /slug/hendy.irawan

What I want is to have a catchall /#{slug} where it can “forward” to /people/#{slug} or /interests/#{slug} depending on the looked up slug.

Thank you.