Pages Navigation Menu

Coding is much easier than you think

Changing default style of s:actionerror / s:actionmessage tag

default style
In struts 2 when you use <s:actionerror /> tag, it displays the errors with bullets, On viewing the page source of the jsp page, we can see that error message is displayed using

  • error 1
  • error 2

But suppose if our requirement is to display the error message without bullet in the action errors or action messages
** UPDATE: Struts 2 Complete tutorial now available here.
There are 2 ways to solve this problem
1. Customized the code in jsp, such that you can specify your own css for displaying the message

2. Change the file in the “/template/simple/actionerror.ftl” and put it in the /web-directory/struts/simple if you are using simple theme

Recommended reading

Similar kind of approach is followed for <s:actionmessage /> tag.

One Comment

  1. you are saying we need to change actionerror.ftl but the question is where to change and to what? your answer is kind of missing the main point which is “how to change the default style of actionerrors” .

Leave a Comment

Your email address will not be published. Required fields are marked *