• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

actionmessages problem

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>?
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
tried <html:errors />
does not work.
 
poornima balagopal
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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");
}
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic