J2EE study notes (6) Struts HTML Tags

Source: Internet
Author: User
HTML Tags
Some common tag attributes have consistent meanings in HTMLTagLib. They are
Name: The instance name of the ActionForm bean. If the name does not exist, the associated formBean Property: property not only determines the fieldname of the generated html, but also the value of this field via formBean. getThisProperty
Value: value determines the value of the field that generates html. Note that it is not the propertyName of bean.
<Html: html> What is different from normal The rest will be added later...
Message (error) display
ActionMessages messages = new ActionMessages ();
Messages. add (ActionMessages. GLOBAL_MESSAGE, new ActionMessage ("userForm. insert", info. getUserName ());
Messages. add ("activationDate", new ActionMessage ("userForm. active", info. getDateLength ());
All messages are displayed as follows, and <li> is used to put them into a list, followed by a customizable header/footer.
<Html: messages id = "message" header = "errors. header" footer = "errors. footer">
<Li> <bean: write name = "message"/> </li>
</Html: messages>
You can specify to only display certain messages as follows:
<Html: messages id = "message" property = "<% = org. apache. struts. action. ActionMessages. GLOBAL_MESSAGE %>">
<Li> <bean: write name = "message"/> </li>
</Html: messages>
Changing "Messages" to "Errors" is an error display. For ease of use, a

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.