In Struts1 and Struts2 have a lot of easy to use tag library , use it can make our page code more concise, easy to understand, specification . the label form is the same as the HTML label . We also explained the custom labels in the above chapters so that we can better understand how to use the tag library and directly understand it as a third-party tag library . So we're going to use it and we're going to introduce it on the page.
Struts2.0 tags can be broadly divided into the following categories:
1.UI (user Interface, UI) Tags: mainly generate HTML element tags;
(1) Form labels: form elements used to generate HTML pages, and labels for normal form elements.
(2) Non-form label: Used to generate the tree on the page, tab, and other labels.
2. Non-UI Tags: mainly used for data access, logic control and other tags;
(1) Process Control Label: mainly includes the label for implementing the Process Control of branch, loop and so on.
(2) data access Tags: mainly includes the values in the output Valuestack, complete the internationalization and other functions of the label.
3.Ajax Tags: tags for ajax support;
According to the first letter of the label can be summed up the following tags:
A:
<s:ahref= "" ></s:a>-----hyperlinks, similar to the <a></a> in HTML
<s:ActionName= "" ></s:action>-----execute an action in a view
<s:Actionerror/>-----If the action's errors has a value then it shows up
<s:Actionmessage/>-----If the message of action has a value then it appears
<s:Append></s:append>-----Add a value to the list, similar to List.add ();
<s:Autocompleter></s:autocompleter>-----Auto-Complete <s:combobox> tag content, this is Ajax
B:
<s:BeanName= "" ></s:bean>-----similar to the value of JavaBean in struts1.x
C:
<s:checkbox></s:checkbox>-----check box
<s:CheckBoxListlist= "" ></s:checkboxlist>-----Multi Box
<s:ComboBoxlist= "" ></s:combobox>-----drop-down box
<s:Component></s:component>-----Image Symbols
D:
<s:Date/>-----Get date format
<s:DateTimePicker></s:datetimepicker>-----Date Input Box
<s:Debug></s:debug>-----Display Error messages
<s:Div></s:div>-----Represents a block, similar to the HTML <div></div>
<s:DoubleselectList= "" Doublename= "" doublelist= "" ></s:doubleselect>-----double drop-down box
E:
<s:ifTest= "" ></s:if>
<s:ElseIfTest= "" ></s:elseif>
<s:Else></s:else>-----These 3 tags to indicate conditional judgment
F:
<s:Fielderror></s:fielderror>-----displaying file error messages
<s:file></s:file>-----File Upload
<s:formaction= "" ></s:form>-----Get the value of the corresponding form
G:
<s:GeneratorSeparator= "" val= "" ></s:generator>----and <s:iterator> tags used together
H:
<s:Head/>-----used in <s:Hidden></s:hidden>-----Hidden Values
I:
<s:i18nName= "" ></s:i18n>-----Load the resource bundle to the value stack
<s:includeValue= "" ></s:include>-----contains an output, servlet or JSP page
<s:Inputtransferselectlist= "" ></s:inputtransferselect>-----get an input to the form
<s:iterator></s:iterator>-----for traversing collections
L:
<s:label></s:label>-----Read-only labels
M:
<s:Merge></s:merge>-----Merging values that are traversed by the collection
O:
<s:Optgroup></s:optgroup>-----Get Tag Groups
<s:OptiontransferselectDoublelist= "" list= "" doublename= "" ></s:optiontransferselect>-----Left and right selection box
P:
<s:param></s:param>-----provide parameters for other labels
<s:Password></s:password>-----Password Entry Box
<s: Property/>-----Get the property of ' value '
<s:PushValue= "" ></s:push>-----value is pushed to the stack so that the property tag can get the properties of value
R:
<s:Radiolist= "" ></s:radio>-----radio button
<s:Reset></s:reset>-----Reset Button
S:
<s:Selectlist= "" ></s:select>-----Radio Box
<s:SetName= "" ></s:set>-----assigning values to a variable in a specific range
<s:SortComparator= "" ></s:sort>-----to list by attributes
<s:Submit></s:submit>-----Submit Button
<s:subset></s:subset>-----To iterate over the set output subset
T:
<s:TabbedpanelId= "" ></s:tabbedPanel>-----Table Box
<s:Table></s:table>-----Form
<s:textName= "" ></s:text>-----i18n Text Information
<s:textarea></s:textarea>-----Text field input Box
<s:TextField></s:textfield>-----Text Input Box
<s:token></s:token>-----Interceptors
<s:Tree></s:tree>-----Tree
<s:TreeNodeLabel= "" ></s:treenode>-----Tree structure
U:
<s:Updownselectlist= "" ></s:updownselect>-----multi-selection box
<s:URL></s:url> Create a URL-----
It's all struts2.0 's tag library.
Conclusion
- Benefit, familiar with STRUTS2 tag library
This site article is for baby bus SD. Team Original, reproduced must be clearly noted: (the author's official website: Baby bus )
Reprinted from "Baby bus Superdo Team" original link: http://www.cnblogs.com/superdo/p/4771729.html
[Javaweb Basics] 014.struts2 Tag Library Learning