InfoCenter Home >
4: Developing applications >
4.2: Building Web applications >
4.2.1: Developing servlets >
4.2.1.3: Servlet content, examples, and samples >
4.2.1.3.5: Enhancing servlet error reporting >
4.2.1.3.5.1: Public methods of the ServletErrorReport class

4.2.1.3.5.1: Public methods of the ServletErrorReport class

To create an error JSP or servlet, you need to know the public methods of the com.ibm.websphere.servlet.error.ServletErrorReport class (the error bean), which are:

    public class ServletErrorReport extends ServletException{
    
    //Get the stacktrace of the error as a string
    public String getStackTrace()
    
    //Get the message associated with the error.
    //The same message is sent to the sendError() method.
    public String getMessage()
    
    //Get the error code associated with the error.
    //he same error code is sent to the sendError() method.
    //This will also be the same as the status code of the response.
    public int getErrorCode()
    
    //Get the name of the servlet that reported the error
    public String getTargetServletName()
    
    }
    

Go to previous article: Enhancing servlet error reporting Go to next article: Serving servlets by classname

 

 
Go to previous article: Enhancing servlet error reporting Go to next article: Serving servlets by classname