本人也是struts 2 的初学者,没有来得及整理见谅
<s:if test="'foo' in {'bb','ccc'}"> 包含1
</s:if> <s:elseif test="'aa' in {'bb','aa'}"> 包含er </s:elseif>
<s:else> 不包含 </s:else>
<s:a href="HelloWorld.action">link</s:a>
<s:url id="url" value="aa.jsp"></s:url>
<s:a href="%{url}">link2</s:a>
<s:property value="username"/><br/>
<s:property value="password"/><br/>
<s:property value="remark"/><br/>
<s:a href="HelloWorld.action">连接</s:a><br/>
<s:select list="list" value="check" name="type">
</s:select><br/>
<s:checkboxlist label="朋友" list="list" value="check"
name="friends"/><br/>
<s:radio list="list" value="check" ></s:radio>
<s:iterator value="list">
<s:property/><br/>
</s:iterator>
<s:if test="list.size()>10">好的</s:if>
<s:elseif test="list.size()<0">不好</s:elseif>
<s:else>坏</s:else><br/>
<s:a href="%{url}">link3</s:a>
<s:a href="%{url}">link4</s:a>
<s:text name="HelloWorld"></s:text>
<s:property value="%{getText('HelloWorld')}"></s:property>
//if else <s:set name="age" value="10"></s:set>
<s:if test="age60}">
老人
</s:if>
<s:elseif test="age>35">
中年
</s:elseif>
<s:elseif test="age>15">
青年
</s:elseif>
<s:else>
孩子
</s:else>
//set
<s:set name="setName" value="values"/>
//iterator
<table border="1">
<s:iterator value="list" id="name" status="st">
<tr <s:if test="#st.odd">bgcolor="red"</s:if>>
<td> <s:property value="name"/>*********<s:property
value="#st.count"/>
</td>
</tr>
</s:iterator>
</table> <table border="1">
<s:iterator value="#
{'key1':'value1','key2':'value2','key3':'value3','key4':'value4'}" id="name" status="st">
<tr <s:if test="#st.odd">bgcolor="red"</s:if>>
<td>
<s:property value="key"/>*********<s:property value="#st.count"/>
</td>
<td>
<s:property value="value"/>*********<s:property value="#st.count"/>
</td>
</tr>
</s:iterator>
</table>
//append
<s:append id="newList">
<s:param value="list"></s:param>
<s:param value="{'ee','ff'}"></s:param>
</s:append>
<s:generator id="china" separator=","
val="'aaaa,ddd,d,f,fd,ddd,ffff,dfd,f767676,sdafasdf'">
<s:iterator status="st">
<tr <s:if test="#st.odd">bgcolor="red"</s:if>>
<td>
<s:property/>*********<s:property
value="#st.count"/>
</td>
</tr>
</s:iterator>
</s:generator>
//subset
<s:subset source="list" start="2" count="3">
<s:iterator status="st">
<tr <s:if test="#st.odd">bgcolor="red"</s:if>>
<td>
<s:property/>*********<s:property value="#st.count"/>
</td>
</tr>
</s:iterator>
</s:subset>
//sort
<s:sort comparator="" source=""></s:sort>
//action
<s:action name=""></s:action>
//bean
<s:bean id="peo" name="tutorial.Person">
<s:param name="name" value="'chianren'"></s:param>
<s:param name="age" value="55"></s:param>
<s:property value="name"/>
<s:property value="age"/>
<s:param name="name" value="'chianrenzzl'"></s:param>
<s:param name="age" value="25"></s:param>
</s:bean>
<s:property value="#peo.name"/>
<s:property value="#peo.age"/>
//date
<%java.util.Date now = new java.util.Date();
pageContext.setAttribute("now",now);
%> <html>
<head>
<title>Hello World!</title>
</head>
<body>
<s:date name="#attr.now" format="yyyy年MM月dd日"
nice="false"/> </body>
</html>
//debug
<s:debug>连接</s:debug>
//include
<s:include value="success.jsp">
<s:param name="author" value="'chinaren'"></s:param>
</s:include>
导入页面,取传值
${param.author}
//push
<s:bean id="per" name="tutorial.Person">
<s:param name="name" value="'chianren'"></s:param>
<s:param name="age" value="90"></s:param>
</s:bean>
<s:push value="#per">
<s:property value="name"/>
<s:property value="age"/>
</s:push>
//set
<s:bean id="per" name="tutorial.Person">
<s:param name="name" value="'chianren'"></s:param>
<s:param name="age" value="90"></s:param>
</s:bean>
<s:set name="xxx" value="#per" scope="session"></s:set>
${sessionScope.xxx.name}<br>
${sessionScope.xxx.age}
<s:set name="china" value="'services people!!'"></s:set>
<s:property value="china"/>
//url
<s:url action="hello">
<s:param name="auther" value="'china'"></s:param>
</s:url>
<br>
<s:url value="hello.jsp">
<s:param name="auther" value="'china'"></s:param>
</s:url>
表单标签
//checkboxlist
<s:checkboxlist label="朋友" list="list" value="check" name="friends"/><br/>
//combobox
<s:form>
<s:combobox list="list" label="朋友" name="book"
labelposition="top"/>
</s:form>
//datetimepicker