exception-type in error-page

Hello!
Is there anyone who succeeded plugging his own exception
type into <exception-type> of <error-page> and
not bumped out by ClassLoader?
Would be glad to hear from you!
Thank you,

Sorry, brain not engaged, here's what I did....
package exceptions;
public class MyException extends Exception {
�public MyException (String reason) { super(reason);  }
�public String toString() { return getMessage(); }
Now a page to throw it:
<%@ page import="exceptions.MyException" %>
<%@ page contentType="text/html; charset=ISO-8859-5" %>
<html>
<head><title>errorGenerator.jsp</title></head>
<body>
<h1>Generate an Exception</h1>
<%
boolean throwIt = true;
if (throwIt)
throw new MyException("Error generated by errorGenerator.jsp");
%>
</body>
</html>
A page to catch it:
<%@ page contentType="text/html; charset=ISO-8859-5" %>
<%@ page isErrorPage="true" %>
<html>
<head><title>errorDisplay.jsp</title></head>
<body>
<h1>Errors</h1>
exception caught = [<%= exception %>]
</body>
</html>
And the relevant part of the web app descriptor:
<error-page>
�<exception-type>exceptions.MyException</exception-type>
�<location>/errorDisplay.jsp</location>
</error-page>
Requesting errorGenerator.jsp gets errorDisplay.jsp with the original message. See also the bookstore1 example in the J2EE tutorial.
James

Similar Messages

  • IMS-exception type "Other errors" is not getting triggered

    Hi experts,
                     I am trying out some scenarios in IMS. I want to check exception type- "Other Errors" which is a most generic exception type. I have tried many options like- removed country from partner id address, tried posting invoice after removing account assignment category but for all these invoice triggers exception- duplicate invoice which i am unable to understand. can anybody please tell me what are the settings required for exception type- other errors?
    2. I even tried exception type "missing goods receipt". Excption type is getting triggered but after creation of confirmation- the status of the exception is not getting changed to clarified. Instead it gives an error- User is locked please try after some time.
    Please help
    Regards
    Kapil

    Hi Friend,
    Please read the possible exception types in IMS
    Have you set these exception in Settings for Invoice Monitor
    Purpose
    In the Settings for Invoice Monitor application, you can make settings directly on the user interface for every exception that you wish to adjust.
    Digital signature
    For each exception, you can define whether you want to use a digital signature.
    If you use a digital signature, the field Digital Signature is active on the Adobe PDF form and the processor of the form has to sign it before sending it back.
    The system then checks that the signature is valid.
    If the signature is invalid, or the processor does not sign the form, an error message is written to the log and the e-mail is closed.
    You can assign a digital signature to a vendor in two different ways.
    ·        The user assigns a partner certificate and sends it to the vendor.
    ·        The user uses the vendor’s signature certificate. This certificate has to be registered on the ADS server. For more information, see the SAP NetWeaver Configuration Guide Interactive Forms based on Adobe Software on the SAP Service Marketplace under service.sap.com/instguidesNW2004s.
    Additionally, you can make settings for the following exceptions:
       Invoice duplicate
    This exception is triggered if you try to post an invoice that has already been posted. The two invoices are compared using criteria that you have specified. In the settings, you can define whether a notification e-mail is automatically sent in the case of an invoice duplicate exception, and to whom this e-mail is sent. Furthermore, you can tailor the duplicate check to suit your requirements. The following criteria are available:
        Consider special characters in the vendor invoice number
         Check the number of items and purchase order number
         Additionally, you can define that the invoice is automatically deleted as soon as the vendor confirms that a duplicate invoice exists.
    ¡        Fields for duplicate check
    On this tab page, you can activate the fields that are relevant for the duplicate check. Furthermore, you can define a maximum variance for each field. In other words, you define whether the data in the fields should be an exact match, or whether small differences are acceptable.
    ¡        Exclude vendor values and or invoice values
    On this tab page, you can exclude certain vendors and/or invoice values from the duplicate check. If, for example, you always receive invoices from one vendor for the same amount, you can enter this here so as to prevent unnecessary checks.
    ¡        Group vendors
    On this tab page, you can group vendors that have several vendor numbers together in a data record to facilitate the duplicate check. Entries in this table cause an update in the TREX database which might lead to a short delay.
    Regardless of your settings, the system performs a standard duplicate check (for vendor invoice numbers or vendor numbers that match exactly, for a +/- 7 day period) to ensure that these duplicates are found. If this standard check is not successful, a further check is performed using the settings that you made.
    ·        Missing external information
    This exception is triggered if you try to post an invoice that contains incomplete or incorrect information. In the settings, you can define whether a notification e-mail is automatically sent in the case of an exception caused by missing external information, and to whom this e-mail is sent. Furthermore, you can define whether the e-mail contains a link to the SRM System, where the missing/incorrect information can be entered directly in an interactive form.
    ·        Missing internal information
    This exception is triggered if you try to post an invoice that contains incomplete or incorrect information. In the settings, you can define whether a notification e-mail is automatically sent in the case of an exception caused by missing internal information, and to whom this e-mail is sent. Furthermore, you can define whether the e-mail contains a link to the SRM System, where the missing/incorrect information can be entered directly in an interactive form.
    ·        Missing goods receipt
    If no digital signature is used, two additional fields are displayed in the PDF form. The processor has to enter his first and last name into these fields before he/she sends the e-mail back.
    In the settings, you can define whether a notification e-mail is automatically sent in the case of an exception caused by a missing goods receipt, and to whom this e-mail is sent. You can define how long the invoice should remain with status 'Waiting for Preceding Documents' before it receives the status 'To be Corrected Manually’. Furthermore, you can define how many days pass before an e-mail is sent to the goods recipient. When the goods recipient then confirms that no goods delivery has taken place, an e-mail is automatically sent to the vendor. If the goods receipt has already taken place, you can either define that the goods recipient confirms this automatically in an interactive form, or that the goods recipient uses a link in the e-mail to confirm the goods receipt in the SRM system.
    ·        Incorrect reference
    This exception is triggered if you try to post an invoice that refers to an incorrect reference. In the settings, you can define whether a notification e-mail is automatically sent in the case of an exception caused by an incorrect reference, and to whom this e-mail is sent. Furthermore, you can define whether the e-mail contains a link to the SRM System.
    ·        Approval overdue
    This exception is triggered if an invoice remains in approval status for longer than allowed. You can define how long an invoice can remain in approval status before the exception is triggered.
    ·        Other errors
    This exception is triggered if you try to post an invoice that contains errors. In the settings, you can define whether a notification e-mail is automatically sent in the case of an exception caused by other errors, and to whom this e-mail is sent. Furthermore, you can define whether the e-mail contains a link to the SRM System.
    Note that the invoice is checked in accordance with the vendor tolerance limits in the case of the following exceptions: If these are exceeded, an error message is output.
    ·        Price variance
    This exception is triggered if you try to post an invoice that contains price variance that exceeds the tolerance limit. In the settings, you can define whether a notification e-mail is automatically sent in the case of a price variance, and to whom this e-mail is sent. You can stipulate that the invoice is posted automatically if the price variance is approved on account of the e-mail. Furthermore, you can define whether the e-mail contains a link to the SRM System.
    ·        Quantity variance
    This exception is triggered if you try to post an invoice that contains quantity variance that exceeds the tolerance limit. In the settings, you can define whether a notification e-mail is automatically sent in the case of a quantity variance, and to whom this e-mail is sent. You can stipulate that the invoice is posted automatically if the quantity variance is approved on account of the e-mail. Furthermore, you can define whether the e-mail contains a link to the SRM System.
    ·        Tax variance
    This exception is triggered if you try to post an invoice that contains tax variance that exceeds the tolerance limit. In the settings, you can define whether a notification e-mail is automatically sent in the case of a tax variance, and to whom this e-mail is sent. You can stipulate that the invoice is posted automatically if the tax variance is approved on account of the e-mail. Furthermore, you can define whether the e-mail contains a link to the SRM system.
    In Invoice monito system pls check the what setting is done for Duplicate  invoice, Missing GR and other invoice.
    Based on these setting only system identifies what type of exception it is.
    In other errors you should mention in Settings for Invoice Monitor  what are the fileds your consider for other exception.
    Hope this information will help.
    Thanks & Best regards
    Girish

  • Getting the name of the page that throws an exception from an error page

    How can I get the name of the page that throws an
    error exception from an error page?.
    Thanks.

    In each of your jsp pages, u should set the name of page in the request object. e.g.
    In jsp page called main.jsp you should do request.setAttribute("pageName","main.jsp");
    Then in error page you can get the name like
    String pageInError = (String) request.getAttribute("pageName");
    I hope that answers your question.
    thx

  • WebDynpro call Returns an exception: Type conversion error

    Hi,
    I'm trying to start some of the standard SAP web dynpro .
    most of then work fine.
    some don't and i get the following error message.
    Root Cause
    The initial exception that caused the request to fail, was:
    +com.sap.aii.proxy.framework.core.DataAccessException: Type conversion error, field TAX_PER_DIEMTAX, complex type class com.sap.xss.tra.tre.model.expenses.Ptrv_Web_General_Data_Int+
    +at com.sap.aii.proxy.framework.core.JcoBaseTypeData.propagateJcoException(JcoBaseTypeData.java:130)+
    +at com.sap.aii.proxy.framework.core.JcoBaseTypeData.setElementValue(JcoBaseTypeData.java:751)+
    +at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClass.setAttributeValue(DynamicRFCModelClass.java:482)+
    +at com.sap.tc.webdynpro.progmodel.context.GenericModelClassCopyHelper.setAttributeValue(GenericModelClassCopyHelper.java:69)+
    +at com.sap.tc.webdynpro.progmodel.context.CopyService.copyCorresponding(CopyService.java:55)+
    +... 66 more+
    See full exception chain for details.
    could anyone give me an hint.
    jco connetion are made and testet for:
    sap_r3_humanresources
    sap_r3_finacials
    sap_r3_selfservicegenerics
    sap_r3_travel
    analog the *_MetaData
    Thank in advance
    Maximilian

    Hello
    did you solve this problem? I have the same error
    Regards

  • About error-page in web.xml

    1)<!ELEMENT error-page ((error-code | exception-type), location)>
      <error-page>
            <error-code>404</error-code>
            <location>/404.html</location>
        </error-page> <error-page error-code='404' location='/404.html'/ > <--why this is wrong???
    2)How to explain the followings? Any examples?
    "If no error-page declaration containing an exception-type fits using the class-heirarchy match, and the exception thrown is a ServletException or subclass thereof, the container extracts the wrapped exception, as defined by the ServletException.getRootCause method. A second pass is made over the error page declarations, again attempting the match against the error page declarations, but using the wrapped exception instead."

    <error-page error-code='404' location='/404.html'/ > <--why this is wrong???Because thats not what the DTD specifies.
    It says that <error-page> must have two sub elements - the <error-code> or <exception-type> and a <location>
    It doesn't say that you can have them as attributes. So what you have typed there is wrong.

  • Error page, catching Exception

    Hello.
    When my page throws Exception, i redirect it to error page.
    I have this code in web.xml:
       <error-page>
          <exception-type>java.lang.Exception</exception-type>
          <location>/error.jsp</location>
       </error-page>      Everything is ok.
    But i want to write this exception to my log. I want do this in error page.
    So my question is:
    how can I get this exception on error page?

    Jsp' directive in /error.jsp
    <%@page isErrorPage="true" %>
    then variable "exeption" is availible in jsp, like this
    <%
    StackTraceElement[] st = exception.getStackTrace();
    %>

  • How to handle multiple exception types in JSF 2?

    I'm trying to handle multiple exception types in JSF2, including a default error page for any unexpected exception types. The problems I'm having are:
    1) ViewExpiredException is handled only when no generic exception handler is specified
    2) "Regular" exceptions like NullPointerException are never handled
    My managed bean:
    @Named
    @SessionScoped
    public class MyController implements Serializable {
    /* A method that does nothing */
    public void doNothing() {
        //do nothing
    /* Generate a null pointer exception on purpose */
    public void generateNpe() throws NullPointerException {
        Object x = null;
        x.toString();
    My test page to generate the exception:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Test page</title>
    </h:head>
    <h:body>
        <h:form>
            <h:commandButton id="button1" value="do nothing" action="#{myController.doNothing}" />
            <h:commandButton id="button2" value="generate NPE" action="#{myController.generateNpe}" />
        </h:form>
    </h:body>
    </html>
    My web.xml:
    <!-- Redirect all NPEs to this page; this never works! -->
    <error-page>
        <exception-type>java.lang.NullPointerException</exception-type>
        <location>/error/error003.jsf</location>
    </error-page>
    <!-- Redirect all VEEs to this page; this works fine if the next section is excluded -->
    <error-page>
        <exception-type>javax.faces.application.ViewExpiredException</exception-type>
        <location>/error/error002.jsf</location>
    </error-page>
    <!-- This grabs everything, even with the previous sections defined.  If I exclude this error-page section, VEE works fine but NPE still does not get redirected -->
    <error-page>
        <exception-type>java.lang.Exception</exception-type>
        <location>/error/error001.jsf</location>
    </error-page>My questions are as follows:
    1) How can we handle "regular" java exceptions like NPE?
    2) How can we define a catch-all for unexpected exception types, while still respecting specific exception handlers for VEE, etc?
    Thanks,
    Benjamin

    Is your data model right? If you are adding in one and deleting in another it sounds to me more like a process that an entity, in which case you may revisit your data model and simplify it, add in a session bean with the process method to co-ordinate between the two.
    However, if you want to map multiple different tables within a single entity bean it is possible and just part of the mapping. How you actualyl specify it depends on which implementation you are working with.
    Cheers,
    Peter.

  • error-page in web.xml not working

    In my web.xml I have
    <error-page>
    <exception-type>java.lang.NullPointerException</exception-type>
    <location>/error.jsp</location>
    </error-page>
    I checked the page works by doing a /context/error.jsp and
    the page displays fine (it is a simple jsp page).
    I hit a struts action that gives me this in the std output.
    06/29 10:48:24 error
    [1]java.lang.NullPointerException
    at
    com.pearson.gs.cms.business.LoginService.verifyPassword(LoginService.java:232)
    at
    com.pearson.gs.cms.action.LoginAction.performCMSAction(LoginAction.java:92)
    at
    com.pearson.gs.cms.action.BaseCMSAction.execute(BaseCMSAction.java:48)
    at
    org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
    at
    org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
    at
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at
    org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at
    jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at
    jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:259)
    at
    jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
    at
    jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    [0]javax.servlet.ServletException
    at
    org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523)
    at
    org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
    at
    org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
    at
    org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at
    org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at
    jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at
    jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:259)
    at
    jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
    at
    jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
    I get a 500 error page instead of my /error.jsp page.
    I tried adding
    <error-page>
    <error-code>500</error-code>
    <location>/error.jsp</location>
    </error-page>
    but that doesn't work either.
    JRun 4.0
    Updater 6
    JDK 1.4.2
    Struts 1.2.8
    Any ideas what to try?

    a. Override your skeletons error.jsp to forward/redirect to your page.
    or
    b. If you primarily use pageflow portlets Define a shared flow which has an exception handling method and direct it to your page. Reference the shared flow in each of your controllers (i think global.app is deprecated in 10 otherwise you could do this there). this lets you log some additional information, plus gives you the added flexibility of dealing with different exception types
    or
    c. Override the path to error.jsp in your portlets properties (havent tested)
    Note if you are using servlets etc you still need your web.xml java.lang.Exception entry. The reason it doesnt get picked up is because the portal framework is handling the exception
    Edited by: deepshet on Dec 22, 2008 8:12 PM

  • Some error pages do not display

              The following error page setup works great:
              <error-page>
              <exception-type>java.sql.SQLException</exception-type>
              <location>/ExceptionServlet</location>
              </error-page>
              When an SQL exception occurs in a jsp or at a lower level, the rror page gets
              invoked. However, when I try this with a simple custom exception class, the error
              page does not get invoked. Here is the web.xml..
              <error-page>
              <exception-type>com.mbs.foundation.dataobject.ValidationException</exception-type>
              <location>/ExceptionServlet</location>
              </error-page>
              Any clue as to why WLS 7 does not like my ValidationException? It is a sub-type
              of Exception, just like SQLException. It does not have any chaining.
              

              Turns out this was a WLS bug, and CR087600 has been filed to address it.
              

  • error-page not working in J2EE SDK 5 Update 1

    I recently migrated from Tomcat 5 to J2EE SDK 5 Update 1, and since, have not been able to get my custom error page working. I have verified the path to the error page by testing the link directly in a browser, but still see the default gray and white error page anytime an error occurs. This exact xml worked perfectly in tomcat 5 - am I missing something?
    I have the following in my web.xml:
      <!-- Http error -->
      <error-page>
        <error-code>500</error-code>
        <location>/error.faces</location>
      </error-page>
      <!-- java exception -->
      <error-page>
        <exception-type>java.lang.Exception</exception-type>
        <location>/error.faces</location>
      </error-page>
      <!-- page not found -->
      <error-page>
        <error-code>404</error-code>
        <location>/error.faces</location>
      </error-page>

    Hi, Here is a link from Mozilla that addresses this : http://support.mozilla.com/en-US/kb/Managing+the+Flash+plugin
    Page down to "Flash does not work properly and /or will not update."
    When you have two SWF installed the websites use the old one, not the new one. Don't ask me why, I often wonder that myself. That's why when you disabled the old one, Flash didn't work.
    Hope this solves the issue.
    Thanks,
    eidnolb

  • Problem displaying error page of web.xml when using JSF, Ajax4jsf

    Hi,
    My application is using MyFaces, RichFaces and Ajax4jsf. When i try to display error page configured in web.xml, i am getting exception "Error while processing error page".
    my web.xml contents are as follows:
    <?xml version="1.0"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <filter>
    <display-name>RichFaces Filter</display-name>
    <filter-name>richfaces</filter-name>
    <filter-class>org.ajax4jsf.Filter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>richfaces</filter-name>
    <servlet-name>faces</servlet-name>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    <filter>
    <filter-name>extensionsFilter</filter-name>
    <filter-class>
    org.apache.myfaces.webapp.filter.ExtensionsFilter
    </filter-class>
    <init-param>
    <description>
    set the size limit for uploaded files. Format: 10 - 10 bytes 10k
    - 10 KB 10m - 10 MB 1g - 1 GB
    </description>
    <param-name>uploadMaxFileSize</param-name>
    <param-value>100m</param-value>
    </init-param>
    <init-param>
    <description>
    Set the threshold size - files below this limit are stored in
    memory, files above this limit are stored on disk.
    Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
    </description>
    <param-name>uploadThresholdSize</param-name>
    <param-value>100k</param-value>
    </init-param>
    </filter>
    <filter>
    <filter-name>Seam Redirect Filter</filter-name>
    <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
    </filter>
    <filter>
    <filter-name>KTServletFilter</filter-name>
    <filter-class>com.kenexa.core.system.KTServletFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>/faces/*</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>Seam Redirect Filter</filter-name>
    <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>KTServletFilter</filter-name>
    <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <!-- seam Listeners -->
    <listener>
    <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
    </listener>
    <listener>
    <listener-class>com.kenexa.kr.web.KRServletListener</listener-class>
    </listener>
    <servlet>
    <servlet-name>faces</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>faces</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/rc/systemError.jsf</location>
    </error-page>
    </web-app>
    As per the configuration, when exception is thrown out of the application, container tries to display systemError.jsp page. If we want to include the JSF tags in systemError.jsp page, the request should pass through FacesServlet, so in the <error-page> <location> tag systemError page is specified with the extention systemError.jsf though it's actual extention is .jsp
    When exception is thrown from the application container invoke the error page but, while rendering systemError.jsf page exception is thrown saying "Exception processing error page "systemError.jsp" "
    To solve this problem i've gone through several forums, materials.
    In one forum a guy said, JSF1.1 spec has some problem in displaying error pages. To solve this don't write <f:view> tags in the error page, use <f:subview> intstead. By reading this, i again changed the contents of systemError.jsp page replacing <f:view> by <f:subview>. But the error is still repeating.
    Finally what i found is, when we use Ajax4jsf in the application, its AjaxViewRender class is throwing exception while rendering error pages configured through web.xml.
    So what i did is i changed error page extention from .jsf to .jsp in the <location> tag. Now jsf won't come in the picture and remove JSF related tags from the systemError.jsp page.
    <error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/rc/systemError.jsp</location>
    </error-page>
    Any comments are welcome----------------------------------------------------------------

    I too iam facing the same problem could you advise if you have found any solutions
              -Ram

  • Error pages in Weblogic 10.3

    I have no problem with error pages by error-type defined in web.xml, but by exception-type does not seem to work. Are there any additinal steps in this configuration?

        <error-page>
            <exception-type>java.lang.Exception</exception-type>
            <location>/Error.jsp</location>
        </error-page>   and in Error.jsp add,
    <%@ page isErrorPage="true" %>
    <html>
    <head>
    <title>Exception occurred</title>
    </head>
    <body>
    <%= exception.toString() %>
    </body>
    </html>

  • How to redirect to an error page when database is down

    We have build an struts/jsp-application with JDeveloper 10g and ADF. If the connection to the database fails, we get a plain page with header "500 Internal Server Error" and the exception and a stack trace. Of course we want to catch this exception and redirect the user to an error page with all of the standard design elements of our site and with a textual description of the error of our one choice.
    Our attempts to solve this includes adding error-page tags with error-code and exception-type:
    <error-page>
    <exception-type>javax.servlet.jsp.JspTagException</exception-type>
    <location>error.jsp</location>
    </error-page>
    <error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>error.jsp</location>
    </error-page>
    <error-page>
    <exception-type>oracle.jbo.JboException</exception-type>
    <location>error.jsp</location>
    </error-page>
    <error-page>
    <exception-type>oracle.jbo.DMLException</exception-type>
    <location>error.jsp</location>
    </error-page>
    <error-page>
    <exception-type>java.sql.SQLException</exception-type>
    <location>error.jsp</location>
    </error-page>
    <error-page>
    <error-code>500</error-code>
    <location>error.jsp</location>
    </error-page>
    Are there other ways to do this, or are there things we have forgotten to do, that has to be done for this solution to work.
    We have also tried try and catch in a variety of the lifecycle methods in the DataAction subclass for the page, but none of these are ever called. It seems the error happens before the first lifecyle method starts. We can't figure out where to catch this exception.
    In other cases the web.xml mechanism seems to work.

    Try the Global Exception Mechanism within Struts...

  • JSP error page in web.xml

    I had a JSP error page spcified through the attribute isErrorPage and referenced in the other JSPs through the errorPage attribute, and everything worked well.
    Then, I decided to specify that errorpage in the web.xml instead :
    <error-page>
      <exception-type>java.lang.Throwable</exception-type>
       <location>/error.jsp<location>
    </error-page>The page is found and everythiing, except that I don't get the Throwable info in the implicit exception object in error.jsp. There's nothing in exception.getMessage().
    Anybody knows why and the solution to this ?

    The JSP spec lets you get the Throwable through the javax.servlet.jsp.jspException request attribute.
    The servlet spec uses the javax.servlet.error.exception request attribute for the same thing.
    Therefore, because of the above unfortunate mismatch, when you switched to a global error page, you could no longer get the Throwable through the implicit exception obj, because the later retrieves Throwable from the javax.servlet.jsp.jspException request attribute.
    The solution would be to retrieve javax.servlet.error.exception from the request yourself in your error page.

  • Getting referrer in error page setup in web.xml

              Hello,
              Is it possible to get the referrer in a JSP when that JSP is
              set up as the error-page element in web.xml when a 404 (or
              any other http error) occurs?
              For example when I type www.me.com/page1.jsp and page1.jsp does
              not exist WLS sends me to my error page. However I want to know
              what page (in this case page1.jsp) it was trying to access.
              Wouldn't this typically be the referrer? When I itirate through
              the headers in my error page the referrer is not one of them.
              regards,
              [email protected]
              

              This works beautifully. Thank you!
              [email protected]
              Dimitri Rakitine <[email protected]> wrote:
              >It was added in Servlet spec 2.3 - see [9.9.1]:
              >
              >If the location of the error handler is a servlet or a JSP page, the
              >request
              >attributes in Table SRV.9-1 must be set.
              >
              >These attributes allow the servlet to generate specialized content depending
              >on the status code, the exception type, the error message, the exception
              >object
              >propagated, and the URI of the request processed by the servlet in which
              >the error
              >occurred (as determined by the getRequestURI call), and the logical name
              >of the
              >servlet in which the error occurred.
              >
              >Table SRV.9-1 Request Attributes and their types
              >Request Attributes Type
              >javax.servlet.error.status_code java.lang.Integer
              >javax.servlet.error.exception_type java.lang.Class
              >javax.servlet.error.message java.lang.String
              >javax.servlet.error.exception java.lang.Throwable
              >javax.servlet.error.request_uri java.lang.String
              >javax.servlet.error.servlet_name java.lang.String
              >
              >so it will work in 6.1 :
              >
              ><web-app>
              > ...
              > <error-page>
              > <error-code>
              > 404
              > </error-code>
              > <location>my404page.jsp</location>
              > </error-page>
              > ...
              ></web-app>
              >
              >and my404page.jsp :
              >
              ><%@ page isErrorPage="true" %>
              ><%
              > System.out.println("Error: " + request.getAttribute("javax.servlet.error.request_uri")
              >+ " is not here");
              >%>
              >
              >bea_user <[email protected]> wrote:
              >
              >> Hello,
              >
              >> Is it possible to get the referrer in a JSP when that JSP is
              >> set up as the error-page element in web.xml when a 404 (or
              >> any other http error) occurs?
              >
              >> For example when I type www.me.com/page1.jsp and page1.jsp does
              >> not exist WLS sends me to my error page. However I want to know
              >> what page (in this case page1.jsp) it was trying to access.
              >
              >> Wouldn't this typically be the referrer? When I itirate through
              >> the headers in my error page the referrer is not one of them.
              >
              >> regards,
              >> [email protected]
              >
              >--
              >Dimitri
              

Maybe you are looking for