• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

configuration doubt

 
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
  • 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: 22503
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks for the explanation.
 
That which doesn't kill us makes us stronger. I think a piece of pie wouldn't kill me. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic