File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes configuration doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "configuration doubt" Watch "configuration doubt" New topic
Author

configuration doubt

Pavel Kubal
Ranch Hand

Joined: Mar 13, 2004
Posts: 356
Hi,

I'have used JSF many times, but there is one thing I'm not certain of. It concerns configuration in web.xml, where we match FacesServlet with *.jsf extension or something like that. But after that we create perfectly working JSF pages with the .jsp extension. Why does it work?

I searched through google, but without any success. Thanks for your replies.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15641
    
  15

Because you're making the common - and invalid - assumption that the app server is a file server. The "JSF" suffix on the URL causes the app server to route the request to the JSF servlet. The JSF servlet can do anything it wants, but what it wants is to build the JSF context, invoke the methods required by the inbound request, and then use the navigation map to determine which JSP to use for the output template.

You can setup the app to look like it's going straight to the JSP, but it's not. Which is why you'll bomb if you code a JSF URL ending with ".jsp" instead of ".jsf". Ending the URL with JSF causes the JSP to be invoked directly by the app server instead of indirectly by the JSF servlet, and the app server doesn't set up the JSF context.


Customer surveys are for companies who didn't pay proper attention to begin with.
Pavel Kubal
Ranch Hand

Joined: Mar 13, 2004
Posts: 356
Thanks for the explanation.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: configuration doubt
 
Similar Threads
How JSP page is internally generating Servlet in JSF framework ?
help to understand basic concept in JSF
Im New to JSF Please help to understand basic concept
Faces Servlet
Mistakenly changed web.xml