Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF tags not rendered

 
Prateek Kumar Singh
Ranch Hand
Posts: 30
Eclipse IDE Hibernate Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Finally i got the solution behind this issue.

1. Check your faces config.xml file for JSF version.



2. The reason of the JSF components not being parsed at all indicates that the FacesServlet hasn't run. This will happen when the request URL doesn't match the url-pattern of the FacesServlet as definied in web.xml. This would mean that the actual url-pattern of the FacesServlet isn't *.xhtml at all. so you can add like -



and access your page like loginPage.jsf .


Hope it helps someone.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Congratulations! You have discovered the difference between a resource path (/abc.xhtml) and a URL (.../abc.jsf)!

The FacesServlet accepts the URL whenever it matches the selection criteria (url-pattern) for the FacesServlet. URLs that don't match that criteria are checked against other servlets' URL patterns and then against the internal default servlet, which will attempt to find a JSP or static resource.

For URLs processed by the FacesServlet when Facelets are involved, the FacesServlet dissects the incoming URL and uses it to build an equivalent resource path, which is where it will attempt to find a View Template to render.

Some other things to note:

1. If you have a loginPage.jsf, I can virtually guarantee you have security problems waiting for you.

2. You do not need all those different URL patterns for the FacesServlet. Generally you'd either have the "*.jsf" pattern or the "/faces/*" pattern or the "*.faces" pattern.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic