action对象放入ValueStack对象,ValueStack对象放入ActionContext对象
在OGNL的context中,有一个根对象ValueStack。在JSP页面中访问context数据时,需要使用#,但ValueStack是其根对象,在访问action属性是,不使用#
OGNL的context还包括其他对象如 parameters、request、session、application、attr
OGNL 创造集合语法{e1,e2}
创造map,#{key1:value1,key2:value2}
in 、not in、?、^、$
<s:iterator value="people.{?this.age>20}" var="p"> 集合people中,每个元素的age大于20
<s:property value="p.name"/>
</s:interator>
2.控制标签
<s:if test="表达式">
</s:if>
<s:append var="新名称">
<span style="white-space:pre"> </span><s:param vaue="合并1"></s:param>
<span style="white-space:pre"> </span>...
</s:append>
</pre><pre name="code" class="html"><s:generator val="%{'aaa,bbb,ccc,ddd,eee'}" count="3" separator="," converter="转换对象" var="生成的iterator设为pageContext属性">
<span style="white-space:pre"> </span> <s:iterator><span style="white-space:pre"> </span>实际上转换成List集合,按顺序push到ValueStack
<s:property /><br/>
<span style="white-space:pre"> </span> </s:iterator>
</s:generator>
</pre><pre name="code" class="html">iterator标签属性 begin end step value var status迭代过程的状态
status="st" st.count st.first st.last st.even st.odd st.index
</pre><pre name="code" class="html">merge 与append元素顺序不同
</pre><pre name="code" class="html">sort标签属性 comparator var source
</pre><pre name="code" class="html">subset标签属性 count var start source decider(org.apache.struts2.util.SubsetIteratorFilter.Decider)
3.数据标签
a标签属性 action href namesapce id method
</pre><pre name="code" class="html">action标签属性 namespace name var flush executeResult ignoreContextParams
</pre><pre name="code" class="html">bean标签属性 name var
</pre><pre name="code" class="html">date标签属性 name var format nice
</pre><pre name="code" class="html">debug标签 用于查看ValueStack StackContext
</pre><pre name="code" class="html">i18n标签属性name
</pre><pre name="code" class="html">include标签与param配合,参数以request方式传入 获取参数${param.paramName}
</pre><pre name="code" class="html">property标签用于输出ValueStack中对象的属性值 value属性
</pre><pre name="code" class="html">push标签 将一个值放入ValueStack 栈顶 仅value属性
</pre><pre name="code" class="html">set标签属性var value scope(默认action)(page request session application action)
</pre><pre name="code" class="html">text标签属性name var searchValueStack
</pre><pre name="code" class="html">url标签属性 var value namespace method action anchor encode escapeAmp includeContext includeParams
4 表单标签
form 标签属性 namespace action
</pre><pre name="code" class="html">submit标签属性 action method
</pre><pre name="code" class="html">checkbox标签属性 label name value(表选中) fieldValue(会屏蔽value属性值,提交时的值)
</pre><pre name="code" class="html">checkboxlist标签属性 name list (listKey listValue 指定list的哪个属性作为value和内容)
list为Map时map的key称为选项的value,map的value称为选项内容
</pre><pre name="code" class="html">combobox标签属性label name list headerKey headerValue
</pre><pre name="code" class="html">doubleselect标签属性 list listKey listValue doublelist doublelistKey doublelistValue doubleName multiple
</pre><pre name="code" class="html">head 标签使用后,在转化时生成指定主题的CSS Javascript的引用
</pre><pre name="code" class="html">file标签属性 name accept
</pre><pre name="code" class="html">hidden
</pre><pre name="code" class="html">lable name value
</pre><pre name="code" class="html">inputtransferselect标签属性 list listKey listValue multiple upLabel downLabel allowMoveUp allowMoveDown addLabel
optiontransferselect标签属性 <pre name="code" class="html">list listKey listValue multiple
<pre name="code" class="html">doublelist doublelistKey doublelistValue doubleName doublemultiple
</pre><pre name="code" class="html">select标签属性<span style="font-family: Arial, Helvetica, sans-serif;">list listKey listValue </span><span style="font-family: Arial, Helvetica, sans-serif;">headerKey headerValue multiple</span>
<span style="font-family: Arial, Helvetica, sans-serif;"> </span>
optgroup<span style="font-family: Arial, Helvetica, sans-serif;">标签属性</span><span style="font-family: Arial, Helvetica, sans-serif;"> </span><span style="font-family: Arial, Helvetica, sans-serif;">list listKey listValue 常与select组合</span>
password属性name size maxlength
radio属性 <span style="font-family: Arial, Helvetica, sans-serif;"> list listKey listValue</span>
<span style="font-family: Arial, Helvetica, sans-serif;">
</span>
<span style="font-family: Arial, Helvetica, sans-serif;">reset 属性name value</span>
<span style="font-family: Arial, Helvetica, sans-serif;">
</span>
<span style="font-family: Arial, Helvetica, sans-serif;">textarea/textfield</span>
<span style="font-family: Arial, Helvetica, sans-serif;">
</span>
<span style="font-family: Arial, Helvetica, sans-serif;">token防止重复提交 需配置 token拦截器</span>
<span style="font-family: Arial, Helvetica, sans-serif;">
</span>
<span style="font-family: Arial, Helvetica, sans-serif;">updownselect 属性</span><pre name="code" class="html">list listKey listValue multiple
moveUpLabel moveDownLabel
allowMoveUp allowMoveDown
allowSelectall
selectAllLabel
5.非表单标签
actionerror
actionmessage
component 用来使用自定义标签、模板、主题
div 把文档分割为独立、不同部分
fielderror