• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

configuration doubt

 
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Pavel Kubal
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the explanation.
reply
    Bookmark Topic Watch Topic
  • New Topic