You can get action name from the context
<s:if test="#context['struts.actionMapping'].name=='addaction'">
do some stuff
</s:if>
سؤال
Now I can get any desired results if I use the <s:if>
tag in Struts2
<s:if test="status==1">
//do some stuff
</s:if>
but I don't know how to get the action currently executed, I am expecting like
<s:if test="action==addaction">
//do some stuff
</s:if>
المحلول
You can get action name from the context
<s:if test="#context['struts.actionMapping'].name=='addaction'">
do some stuff
</s:if>
نصائح أخرى
Try this
<s:if test='%{com.opensymphony.xwork2.ActionContext.name=="YourActionName"}'>
//do some stuff
</s:if>