aspose file tools*
The moose likes Struts and the fly likes Displaying actionmessages on the same page in Struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Displaying actionmessages on the same page in Struts2" Watch "Displaying actionmessages on the same page in Struts2" New topic
Author

Displaying actionmessages on the same page in Struts2

Anil Verghese
Ranch Hand

Joined: Oct 11, 2006
Posts: 155
Hi,

How do we display actionmessages/actionerrors on the same page in Struts2? Kind of urgent...
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

<result name="input">inputjsppage.jsp</result>
If you want to display the action error messages you should "input" in result. The default return is "input" there is any error in the action class.


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Anil Verghese
Ranch Hand

Joined: Oct 11, 2006
Posts: 155
I am using Struts 2... and everytime a message has to be shown i insert the message into addActionMessage(); I have included a <s:actionmessage/> in my jsp but due to some reason everytime the message has to be dis[played the same page gets reloaded but with the message. The issue here is instead of a single page i get the same page twice one loaded over the other?
Robin John
Ranch Hand

Joined: Sep 10, 2008
Posts: 270

Redirecting to the same action / jsp and including the



in the code after the validation should do the job, but you say it doesn't so paste your code here... 'action' class, struts.xml, web.xml, jsp.. etc... lets see what you have...


Time is what we want the most, but what we use the worst. -- William Penn
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Displaying actionmessages on the same page in Struts2