• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

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");
}
 
What do you have to say for yourself? Hmmm? Anything? And you call yourself a tiny ad.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic