aspose file tools*
The moose likes JSP and the fly likes error-page tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "error-page tag " Watch "error-page tag " New topic
Author

error-page tag

Murali Atmakuri
Greenhorn

Joined: Dec 13, 2004
Posts: 4
When i used this tag for 404 HTML error code,this is working randomly.
When requested for a non existing resource, sometimes it diplays my error page and sometimes it displays the Tomcat's error page with message and sometimes browser's "The page cannot be found" is displayed.

Can any one help me in explaining why this is happening?


JCP 1.4 ,SCWCD (Preparing)
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Could it be that the requests which are causing the tomcat 404 page to be shown have URLs which are outside the context where they are defined?

Example:
http://localhost:8080/your_context/asdf
Showing your 404 page.

http://localhost:8080/asdf
Showing the tomcat 404

If this is the case, you might consider adding your custom 404 handling to the ROOT application. Either that or make your app the default app.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Murali Atmakuri
Greenhorn

Joined: Dec 13, 2004
Posts: 4
Ben,
The requests are within the context and often it displays the browser's 404 "Page no displayed" message of the browser.

Example:
http://localhost:8080/myApp/asdf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

The browser's 404 page is a different issue.

MSIE, by default, will display it's own error message when a site sends back a failing response code (404 in this case). You can stop this by going to Tools -> Options -> Advanced (tab) -> and then unchecking the "Show Friendly Http Errors" checkbox.
Murali Atmakuri
Greenhorn

Joined: Dec 13, 2004
Posts: 4
Ben,

Thanks for that! I can now see my error page
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: error-page tag
 
Similar Threads
Irritating tag error behavior, JspException not caught by Jsp
how to log errors occurred in backend java engine or servlet
isErrorPage page directive
Error: DispatchMapping[/login] does not define a handler property
Internet Explorer cut off select tag values.