I have a properties file (resource bundle). I am trying to show errors in one of the jsp by loading them from properties file. I have an entry as below in my properties file.<
The
and
tags will encapsulate your actionerrors
and actionmessages
in
.
This will make your message starting with a circle dot (because it is inside an ) and the other nested
with the circle outline (as defined by HTML for second-level
).
This:
will generate:
-
The password you have entered does not
meet password strength requirements. Please select a new password that conforms
to the following standards:
- Minimum length of 8 characters
- Maximum length of 18 characters
- At least one upper-case character
- At least one lower-case character
- At least one non-alphabetic character
- Does not contain 3 or more consecutive repeating characters (e.g. AAA)
- Does not contain the User ID
- Does not contain common dictionary words
more than 4 characters long
- New Password should not be the same as
previous password
To generate the output you want, you can write your own .ftl, or more easily avoid using the
/
tags, and do the loop by yourself:
result:
You can do the loop for actionMessages
, actionErrors
and eventually fieldErrors
and put them in a messages.jsp
snippet, so you can use it in every page (without rewriting it every time) with something like: