Search code examples
spring-roo

Descriptions for each Field in Spring


I have a spring roo project and for each field in my entity I want to add some sort of description for it such that the user can see what kind of input is expected and how they should input it. What is the best way to go about doing this? I know I will probably have to do something in either HTML or javascript but since I don't know too much about either. I've just been creating everything through the roo shell.


Solution

  • I don't know the command in the roo shell for this but here are the findings of some reverse engineering I've done:

    Looking at the vote example that Spring Roo is shipping with, the password i.e. input field section is showing a nice message. This along with all the other messages are grouped into src\main\webapp\WEB-INF\il8n\messages.properties. The password message for instance in that props file is called security_login_form_password_message. In the view (login.jspx) this entry is read as follows:

    <spring:message code="security_login_form_password_message" var="pwd_msg" htmlEscape="false" />