This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JSF and the fly likes first JSF page... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "first JSF page... " Watch "first JSF page... " New topic
Author

first JSF page...

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
With the following files:



Now, here, we can't directly access JSP page(http://localhost:8081/JSFLogin/pages/test.jsp), if we do that then an exception is thrown. Because FacesServlet should be initialized (called) before we access any tag of JSF. So for accessing this JSP page we will have to go through the FacesServlet...

So as per mapping in web.xml, we will access it with faces extension (http://localhost:8081/JSFLogin/pages/test.faces), it will call FacesServlet and that will display our test.jsp.

Now, my confusion is, why we need faces-config.xml in this example??? (we are not providing any navigation rule, managed bean etc).

Please guide...

And also, all my assumptions are right or not??

Thanks a lot.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
I think, I understood it.

Actually, whether we are using faces-config.xml in this example or not, FacesServlet class try to find this file, loads the content of this file into some object, initialize any bean if present etc. So if we don't provide faces-config.xml the FacesServlet doesn't let us to go ahead...

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: first JSF page...