一个关于struts标签的小问题~~~~
我想实现的功能是,用户通过下拉列表选择用户id进行检索,提交到action,我把检索条件在action里用request.setAttrubute("id",id)存起来。返回检索结果后,希望下拉列表还能显示用户选择的结果,比如他选择了id=5,检索回来,出现了id为5的用户的详细信息,并且下拉列表的检索条件选择的还是5
我是这么实现的
<select name="users" style="width:100pt">
<option value=""></option>
<logic:notEmpty name="userList">
<logic:iterate id="UL" name="userList">
<option value="<bean:write name="UL" property="userId"/>" <logic:equal name="id" value="<bean:write name="UL" property="userId"/>">selected="selected"</logic:equal>><bean:write name="UL" property="userId" /></option>
</logic:iterate>
</logic:notEmpty>
</select>
主要是这行<logic:equal name="id" value="<bean:write name="UL" property="userId"/>">selected="selected"</logic:equal>有错误
说是org.apache.jasper.JasperException: /JspPages/employee/searchEmployee.jsp(60,130) equal symbol expected
我感觉是标签嵌套的问题,这样用应该是没有错的……因为value后面不跟<bean:write>的话类似功能就可以实现。
我是这么实现的
<select name="users" style="width:100pt">
<option value=""></option>
<logic:notEmpty name="userList">
<logic:iterate id="UL" name="userList">
<option value="<bean:write name="UL" property="userId"/>" <logic:equal name="id" value="<bean:write name="UL" property="userId"/>">selected="selected"</logic:equal>><bean:write name="UL" property="userId" /></option>
</logic:iterate>
</logic:notEmpty>
</select>
主要是这行<logic:equal name="id" value="<bean:write name="UL" property="userId"/>">selected="selected"</logic:equal>有错误
说是org.apache.jasper.JasperException: /JspPages/employee/searchEmployee.jsp(60,130) equal symbol expected
我感觉是标签嵌套的问题,这样用应该是没有错的……因为value后面不跟<bean:write>的话类似功能就可以实现。
...全文
相关推荐
struts2 optiontransferselect标签使用中的问题
NULL 博文链接:https://hanxin0311.iteye.com/blog/443327
struts的htmlcheckbox标签的默认选中问题
struts的htmlcheckbox标签的默认选中问题
struts2.0 checkbox标签使用问题
工程文件 博文链接:https://selvemen.iteye.com/blog/453223
Struts2标签 s:if test 判断String类型的对象属性值和单字符是否相等的问题
<s:if> 在进行字符创和字符比较时,会忽略一些细节,对于对该控件不是经常使用的,需要注意与字符和字符串的比较的区别
Struts标签库查询手册
Struts标签库查询手册


Web 开发
