Re: Mapping a servlet to a prettier url thanks to pretty faces: is that possible?

Splash Forums PrettyFaces Users Mapping a servlet to a prettier url thanks to pretty faces: is that possible? Re: Mapping a servlet to a prettier url thanks to pretty faces: is that possible?

#20903

I for myself always use PrettyFaces in conjunction with JSF, so I’m not a real expert here but you should try something like this:

<url-mapping id="confirm">
<pattern value="/confirmationAbonne/#{abonneToken}"/>
<view-id>/ConfirmationAbonneServlet</view-id>
</url-pattern>

See this page for details:

http://ocpsoft.com/docs/prettyfaces/3.2.0/en-US/html/Configuration.html#config.pathparams

Or perhaps with a rewrite rule:

<rewrite match="^/confirmationAbonne/([w-]+)$" substitute="/ConfirmationAbonneServlet?abonneToken=$1" redirect="chain"/>

See here:

http://ocpsoft.com/docs/prettyfaces/3.2.0/en-US/html/inbound_rewriting.html#inbound_rewriting.matching

I hope this helps

Christian