You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by vishakha sawant <vi...@gmail.com> on 2005/12/15 11:31:40 UTC

Need help about storeException method of ExceptionHandler

Hi,
I am trying to use ExceptionHandler to handle the exception and to throw the
customized error message using <html:error/> tag but I am not able to
display the message.
I want help about what actually storeException method do.
I tried google search but I didnt get clear Idea about that.
Code of ExceptionHandler

    // create action forward
    ActionForward forward = new ActionForward(config.getPath());
    // Store the ActionError
   // storeException(request, "your application is dead", new
ActionError("Exception", "Exception"), forward, "string 4");
    Exception santaException = (Exception) exception;
    ActionError error = new ActionError
      (santaException.getMessage ());
    // ActionForward forward = mapping.getInputForward ();
    String property = ActionMessages.GLOBAL_MESSAGE;
    String scope = config.getScope ();
    storeException (request, property, error, forward, scope);
    System.out.println("i am in exception handler");
    return forward;
    //return forward;
And I want to display error on jsp page using <html:error/> tag
 Code of Error.jsp

<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<html>
  <head><title>Simple jsp page</title></head>
  <body>Place your content here</body>
  <h1>An Error Has Occured</h1>
    Please notify your system administrator with the following message:<br>
  <html:errors />
</html>

But I got following output


Place your content hereAn Error Has Occured Please notify your system
administrator with the following message:


Please help me

Vishakha