Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

404 error while loading .xhtml page while implementing JSF 2.0  RSS feed

 
vamsi kantamneni
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am new to JSF and when i try to implement a sample application im getting this wierd error of page not found(.xhtml)
here is the code i have created..

here is my bean class


here is my login.xhtml





here is my web.xml



these are the jars ive used
commons-logging 1.1.1
myfaces-api 2.0.7
myfaces-impl 2.0.7

Please help me out from this error..
 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Standard disclaimer: user logins are horribly insecure. Use the J2EE standard security system unless you are doing this just as an academic exercise and don't plan to expose it to the Internet.

Also, your backing bean wouldn't be found because the @ManagedBean annotation for UserLoginBean will store the instance under the session object name "userLoginBean". For JavaBeans, class names begin upper-case, instance and property names begin lower-case.

Your most prominent problem, however, is mistaking the resource name (.xhtml) for the URL name (*.jsf or similar). JSF doesn't "load an xhtml page", it accepts a URL (such as /login.jsf), rips it aparts, constructs a resource name (such as /login.xhtml), then compiles that resource to produce the JSF Component tree. If you use "*.xhtml" as your FacesServlet URL pattern, things will be confusing at a minimum.

Also be aware that stuff referenced in the web.xml such as the welcome page and the login/loginfail pages are typically invoked straight from the container, which may bypass the normal URL processing (and therefore also bypassing the FacesServlet). For maximum reliability, a stock JSP or HTML page is recommended for such things, and that page can then do a redirect.
 
Peter Fernandes
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am also getting the same error 404 page not found. Here is the web.xml. Using eclipse & Jboss.


 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We would prefer that if you introduce a new problem, you start a new thread of your own. It's less confusing that way.

I'm afraid that without an example of the URLs you are submitting, we have no way of telling why you'd get a "404" error.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!