I am getting error when i refer display tag reference from struts tag.
<display:table name="lstEntities" uid="prty">
<display:column property="propertyType开发者_Python百科.propertyTypeName"
titleKey="common.propertytype" />
<display:column property="propertyName" titleKey="common.property" />
<display:column titleKey="common.concern" >
<s:select list="${prty.propertyConcern}" listKey="prtyCrnId" listValue="concern.concernText"></s:select>
</display:column>
</display:table>
Error:
Custom tag attribute list cannot be runtime expression. value: "[${prty.propertyConcern}]"
Please help me. how to resolve this.
Such expressions were allowed in earlier releases of Struts2, but were turned off after struts 2.0.10 to resolve a security issue.
You should be able to access the "prty" object in struts tags using this alternative syntax:
<s:select list="#attr.prty.propertyConcern" listKey="prtyCrnId" listValue="concern.concernText"></s:select>
Modifying fieldValue="#attr.resultTable1.id"
to fieldValue="%{#attr.resultTable1.id}"
resolved my problem.
i.e.:
<display:table name="libraryList" requestURI="showCopyTravelType.action" sort="external"
defaultsort="1" pagesize="10" uid="resultTable1" partialList="true" size="totalRecordCount">
<display:column title="Select">
<s:checkbox id="copiedFlag" name="copiedFlag" fieldValue="%{#attr.resultTable1.id}" />
</display:column>
<display:column property="code"/>
<display:column property="name" />
<display:column property="description" />
<display:footer>
<s:submit action="copyTravelType" />
<s:submit action="searchTravelType"/>
</display:footer>
</display:table>
<s:select list="#attr.prty.propertyConcern" listKey="prtyCrnId" listValue="concern.concernText"></s:select>
If we want a list then the parameter should passed like:
list="%{#attr.prty.propertyConcern}"
精彩评论