• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

<error-page> tag mechanism

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I put this tag in web.xml:


but when the error occurs my browser doesn't show errormessage.jsp! instead I see this message:

The website cannot display the page
HTTP 500
 
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As this is not Tomcat-specific, it's been moved to the Servlets forum.
 
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is present inside errormessage.jsp ??

 
Kamila Rutkowski
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ravi Kiran Va wrote:what is present inside errormessage.jsp ??



<%@ page isErrorPage="true"%>
<html>
<head></head>
<body>
An error has occurred.
</body>
</html>
 
Ranch Hand
Posts: 2066
IntelliJ IDE Clojure Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try to use <error-code>.
 
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Two things!

1. Have you tried putting this code in your jsp throwing any subclass of Throwable?


2. Have you checked if the page not displayed due to some kind of Error which is not a sub-class of Throwable?

Try to use <error-code>.


You don't need to necessarily use errorcode, errorpage should work.

Cheers,
Naren
---------------------------------
SCJP
SCDJWS
SCWCD
 
Kamila Rutkowski
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Error is a sub-class of Throwable. I don't want to use because my project is JSF based on Facelets.

Naren Chivukula wrote:Two things!

1. Have you tried putting this code in your jsp throwing any subclass of Throwable?


2. Have you checked if the page not displayed due to some kind of Error which is not a sub-class of Throwable?

Try to use <error-code>.


You don't need to necessarily use errorcode, errorpage should work.

Cheers,
Naren
---------------------------------
SCJP
SCDJWS
SCWCD

 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
IntelliJ IDE Clojure Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think, we should specify 3 things.

1) In web.xml, the DD
2) isErrorPage attribute of page directive of the error jsp/html.
3) setting the errorPage attribute of the page directive of the jsp with corresponding error page.
 
"I know this defies the law of gravity... but I never studied law." -B. Bunny Defiant tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic