struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yasser Zamani <yasserzam...@apache.org>
Subject Re: Struts2.x ActionError And ActionMessage
Date Fri, 17 Nov 2017 05:42:14 GMT


On 11/16/2017 8:09 PM, Dhulipudi, Sivannarayana wrote:
> when ever validation failed, I want to create one action error message and keep that
action error in context

Hello Dhulipudi, Welcome!

Could you try below please....

ActionSupport myCurrentActionSupport = (ActionSupport) 
ActionContext.getContext().getValueStack().peek();

myCurrentActionSupport.addActionError("my error");

>  and display error message in jsp page

<s:actionerror/> <!-- in your jsp -->

Regards,
Yasser.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message