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.
1 Comment
Vinod Kumar Kashyap
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.