1. Configure and use Struts labels.
Configuration: Add Message-resources to the Struts-config.xml configuration file and copy the MessageResource. properties file to src.
Labels are view technologies and executed on the server.
Usage:
- BeanWrite: Introduce the tag library <% @ taglib prefix = "bean" uri = "http://struts.apache.org/tags-bean#%>, basic string, HTML string (filter = false ), format = "###,###. 0000 "), format the date (format =" yyyy-MM-dd HH-mm-ss "), and obtain the object (property," property. property ");
- Logic: Introduce the tag library <% @ taglib prefix = "bean" uri = "http://struts.apache.org/tags-logic#%> logic: empty is empty, logic: notEmpty is not empty, and logic: present exists, logic: notPresent does not exist
- Logic: Iterate label: cyclically fetch data
<Logic: notEmpty name = "userlist">
<Logic: iterate id = "u" name = "userlist">
<Tr> <td> <bean: write name = "u" property = "username"/> </td>
<Td> <bean: write name = "u" property = "age"/> </td>
<Td> <bean: write name = "u" property = "group. name"/> </td>
</Tr>
</Login: iterate>
</Logic: notEmpty>