aspose file tools*
The moose likes Struts and the fly likes how to access actionErrors in Struts2? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to access actionErrors in Struts2?" Watch "how to access actionErrors in Struts2?" New topic
Author

how to access actionErrors in Struts2?

Peter Lo
Greenhorn

Joined: Jun 22, 2007
Posts: 4
Hi,

Can someone please help me? What might the equivalent of the following Struts1 code be in Struts2? Is there maybe a way to access the actionErrors using the [s:if] tag?

[logic:messagesPresent]
//some custom HTML code

[ul][html:messages id="error"]
[li][bean:write name="error" filter="false"/][/li]
[/html:messages][/ul]

//some more custom HTML code
[/logic:messagesPresent]

I would appreciate any help that anyone could give.
swarna dasa
Ranch Hand

Joined: Mar 15, 2007
Posts: 108
i think they have action errors n field errors

<s:actionerrors/>
<s:fielderrors/>
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to access actionErrors in Struts2?
 
Similar Threads
How to display validation message on top of form
Errors populated in ActionMessages is not displaying
How to transport the stacktrace of an Exception from a Action to a Error-JSP?
html:messages
Messages displayed only if I use saveErrors()