• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to redirect the none existing page to 404 page.  RSS feed

 
Hantsy Bai
Greenhorn
Posts: 4
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use jsf 2.1 , prettyfaces 3, spring 3, tomcat 7 in project...
It is very strange that when I access a none existing jsf pages, it displays a empty page(in firebug the status code is 200) instead of redirecting to 404 page(I have defined a 404 page in web.xml)...
Any help is appreciated.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
 
Hantsy Bai
Greenhorn
Posts: 4
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Only the jsf page have problem, I defined Faces Servlet servered *.xhtml ...

If i type another non jsf page...such as http://localhost:8080/test/xxxxxv
it is not processed by jsf servlet, it will redirect to 404 page as excepted.

But if I accessed the url like http://localhost:8080/test/xxxx.xhtml it will be processed by jsf servlet, and displayed a empty page, and the status code is 200 instead of 404( I detected this in firebug).

The jsf servlet definition.



 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!