Skip to main content

alternatives to having /faces in the request URL

3 replies [Last post]
kaz2324
Offline
Joined: 2009-05-02

I'm asked to look into alternatives to having /faces (or whatever string used for in web.xml) in the request url that eventually invokes the FacesServlet, so if the request url is for example:

http://servername/webapp/faces/resource.xxxx
they want it to be:
http://servername/webapp/resource.xxxx
and still have FacesServlet handle the request.

So, I added a Filter implementation to intercept the request and then add/append the required url-pattern to the request. BUT, they don't like that solution either.

Question is:
As FacesServlet is a uhh Servlet, how else can one achieve this requirement?

Thx for any feedback.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kaz2324
Offline
Joined: 2009-05-02

Thank you both for sharing your thoughts. I have looked at the PrettyFaces solution and so far it seems that it addresses our needs...and then some.

moritzthielcke2
Offline
Joined: 2010-07-11

i simple map the FacesServlet to *.html

so everything requested with *.html gets handled

this may work out for you

Message was edited by: moritzthielcke2

Lincoln Baxter, III

Mapping everything to .html will work (you need to map Faces Servlet to
"*.html" in web.xml in order to achieve this), but if you want control of
the URL (in addition to changing how files are accessed,) you might want
take a look at PrettyFaces - a URL-rewriting solution for JSF.

http://ocpsoft.com/docs/prettyfaces/snapshot/en-US/html/index.html
http://ocpsoft.com/prettyfaces/

Let me know if you have any questions.

--Lincoln

On Sun, Jul 11, 2010 at 1:29 PM, wrote:

> i simple map the FacesServlet to *.html
>
> so everything requested with *.html gets interpreted as jsf2
>
> this may work out for you
> [Message sent by forum member 'moritzthielcke2']
>
> http://forums.java.net/jive/thread.jspa?messageID=477292
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>

--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
[att1.html]