Announcement Announcement Module
Collapse
No announcement yet.
How to catch status codes for display on error.jsp web page Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to catch status codes for display on error.jsp web page

    Hi all,

    I am a definite newbie. Is there an easy way to

    1) Send all status codes (500,400,404,408,etc) to a given XXXX.jsp page?

    2) Turn around and display the status codes dyanically on the XXXX.jsp page? (For example, if it is a 500 error, show "The server returned a 500 error".)

    I already have a page that implements the HandlerExceptionResolver (or SimpleMappingExceptionResolver, depending on who is giving the requirements that day), but when I go through and put

    <error-page>
    <error-code>403</error-code>
    <location>/Error.jsp</location>
    </error-page>

    in my web.xml, it doesn't seem to be hitting anything of the bean behind the Error.jsp.

    (Defined as:

    <bean name="/Error.jsp" class="com.XXX.controller.ExceptionController">
    <property name="defaultErrorView" value="Error" />
    <property name="bfconfig" ref="bizflow" />
    </bean>

    )

    This is very frustrating--I'm stuck on version 2.5 and can't find a way to streamline this without a series of error-page blocks in the web.xml, even if I could get the status codes to work. (Version 3 has an awesome class that handles each one for me and that I could do some awesome stuff with.)

    Basically, I need to be able to show a friendly error message for everything--a stock standard "Hey, it's the server not you" with either a stack track for exceptions or a bit of custom text "We couldn't find the page" for error tracking.

    Anyone have any ideas?

    Thanks in advance for any help,
    A newbie
Working...
X