File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

actionmessages problem

 
azhar bharat
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am having problem displaying the errors from my action form.

Action Code:

JSP page code

I dont know what I am doing wrong, but the error message is never shown.

Further down, i have another piece of code which is to show a message when all operations complete succesfully.
Action Servlet code:


This code works perfectly, and the message is displayed.

Further more, the error messsages are saved in the session, but somehow not displayed. I am sure of this because, after the conditions are met and the failure page is displayed, If I take any other page which contains "html:messages" tag, this message is shown in that page.

So, what could be the problem>?
 
poornima balagopal
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Can you just try by adding the following tag in your jsp page?

<html:errors/>
This tag is used to access and present the results of Struts' data validation. Errors detected by other portions of the framework are accessible to the View component via this tag.

Mean while you can go through this link also.
http://forum.java.sun.com/thread.jspa?threadID=476429&messageID=2212084
 
azhar bharat
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tried <html:errors />
does not work.
 
poornima balagopal
Ranch Hand
Posts: 83
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which version of struts you are using? check out the following code. Hope this may help you.
catch(Exception e) {
ActionMessages actionMessages = new ActionMessages();
actionMessages.add("Customers.update", new ActionMessage("errors.update", e.getClass().getName()
+ ": " + e.getMessage()));

saveErrors(request, actionMessages);

return mapping.findForward("failure");
}
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic