This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes e.getMessage() not get printed on JSP using ActionError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "e.getMessage() not get printed on JSP using ActionError" Watch "e.getMessage() not get printed on JSP using ActionError" New topic
Author

e.getMessage() not get printed on JSP using ActionError

David Dhune
Greenhorn

Joined: Sep 28, 2006
Posts: 14
Hi,

My code is as follows it prints only the System.Exception value
which is in Application resource properties but not the e.getMessage()

Using System.out.println it prints it on console but not on the JSP page

Is some setting/ configuration is required to get the e.getMessage() printed on JSP

Thanks

Code Fragment

} catch (Exception e) {
System.out.println(e.getMessage());
errors.add("systemException", new ActionError
("System.Exception", e.getMessage()));
saveErrors(request, errors);
forward = mapping.findForward("error");
}

JSP page

<html:errors property="systemException"/>

Application resource properties file

System.Exception=Exception:

Result is Exception:
there is no e.getMessage() printed but the console prints it....

I also tried
errors.add("systemException", new ActionError
("System.Exception", "test"));

but same result... please help
Purushoth Thambu
Ranch Hand

Joined: May 24, 2003
Posts: 425
In the application resource property specify
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: e.getMessage() not get printed on JSP using ActionError
 
Similar Threads
Unhandled exception in lookup [Root exception is org.omg.CORBA.NO_PERMISSION
ActionError issue
validate() Method in action form
Using ActionErrors with Exceptions
Limitations on use of html:errors