• Post Reply Bookmark Topic Watch Topic
  • New Topic

How JSF is navigated to First Page?

 
Imran Vohra
Ranch Hand
Posts: 77
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am new to JSF and started learning from guessNumber example of SUN tutorial.
I got the idea about navigation rule. I mean how navigation flows from first to second page and so on.
But, I am not clear how it go to first page.

This is my index.jsp


My question is how it go to inputNumber.jsp ? I mean, why it search only for JSP file and not any other file?

Is it handled by FacesServlet? Or something else?

Thanks
Imran
 
Tim Holloway
Bartender
Posts: 18414
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're on the trail. In your web.xml file, you define servlet mappings. If you check, you'll see that you've got a mapping such that any URL ending in ".jsf" gets mapped (and therefore routed) to the FacesServlet.

The FacesServlet will then deconstruct the URL to get the view path. The resource path it builds will then be modified to reference the source JSP page, resulting in a resource pathname of "/pages/inputNumber.jsp". The FacesServlet will then forward to that resource.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!