I want to change my code from struts1 to struts2,I use displaytag and <bean:write> to show following code,it can run well,<bean:write name="element" property="ID"/> will show 1,2,.... <%@ taglib uri="/struts-tags" prefix="s" %> <display:table name="testList" export="false" sort="external" defaultsort="1" pagesize="2" id="element" size="rsize" requestURI="/test.do"> <display:column title="choice"> <input type="checkbox" id="c1" name="id1" value=<bean:write name="element" property="ID"/>> </display:column>
I know struts2 will use <s:checkbox> and use <ww:property value="id" /> to replace <bean:write name="element" property="ID"/>,so I modify code like follows: <%@ taglib uri="/struts-tags" prefix="s" %> <display:table name="testList" export="false" sort="external" defaultsort="1" pagesize="2" id="element" size="rsize" requestURI="/test.do"> <display:column title="choice"> <s:checkbox name="id" fieldValue=<ww:property value="id" />/> </display:column> But when I run it,I find <ww:property value="id" /> don't make any function,checkbox's value is still <ww:property value="id" /> and not the real value "1,2,3...." I am puzzled with struts2,because there is not a learning book about struts2,the struts2 document is very brief,not detail! Anybody could give me a detail method to resovle my above question? Thanks in advance Best regards, Rod