In struts 2 when you put <s:actionerror /> tag it displays the errors in the following way:
<ul> <li>error 1</li> <li>error 2</li> </ul>But sometimes it seems to be very ugly when displaying the dot (.) in the action errors or action messages Below is a normal code that displays the tags in your customized way. You can specify your own css for this
<s:if test="hasActionErrors()"> <s:iterator value="actionErrors"> <span class="errorMessage"><s:property escape="false" /> </span> </s:iterator> </s:if>Alternatively you can change the file in the "/template/simple/actionerror.ftl” and put it in the /web-directory/struts/simple if using simple theme Similar for <s:actionmessage /> tag. Enjoy Struts
Hi ,
ReplyDeleteim getting blank page if i deployed and executed the first sample,im new to struts2 ,i dont know how to run the sample
Hi Vinod,
ReplyDeleteThis is very useful programming tip. Thank you.
Regards,
Srinivas
Yes it works fine.
ReplyDeleteVery good idea, I was exactly seeking for the same stuff.
thanks Vinod
10x Vinod :)
ReplyDeleteTHANK YOU SO MUCH!!!
ReplyDeleteThanks Vinod
ReplyDeleteThanks Vinod. You are the man.. Keep it up
ReplyDeleteThanks! The tip was very useful.
ReplyDeleteThanks Vinod
ReplyDeleteVery much
It is working fine for me
Ace, cheers!
ReplyDeletethanks
ReplyDeleteThanks for the snippet, Vinod
ReplyDeletethanks
ReplyDeleteThank you very much ,you saved a lot of time
ReplyDelete