struts2 支持标签,而且使用简单,其中 Java Date 类型可以直接以格式化输出,举例如下:
<s:date name="person.birthday" format="dd/MM/yyyy" />
<s:date name="person.birthday" format="%{getText('some.i18n.key')}" />
<s:date name="person.birthday" nice="true" />
<s:date name="person.birthday" />
struts2 的 if else 标签举例如下:
<s:if test="%{false}">
<div>Will Not Be Executed</div>
</s:if>
<s:elseif test="%{true}">
<div>Will Be Executed</div>
</s:elseif>
<s:else>
<div>Will Not Be Executed</div>
</s:else>
参考信息
https://struts.apache.org/docs/date.html
https://struts.apache.org/docs/elseif.html
其它标签可参考
https://struts.apache.org/docs/generic-tag-reference.html