当前位置: 代码迷 >> Java Web开发 >> struts2的<s:optiontransferselect>疑问解决思路
  详细解决方案

struts2的<s:optiontransferselect>疑问解决思路

热度:167   发布时间:2016-04-17 00:47:56.0
struts2的<s:optiontransferselect>疑问


我已google 百度 相关信息,得到帮助办法为:

  1. <%@taglib prefix="sx" uri="/struts-dojo-tags"%> //包struts2-dojo-plugin-2[1].1.6.jar添加了

  2.<sx:head/>或者<s:head/>

我的标签源码:

<s:optiontransferselect
  doubleList="techerList" doubleName="techerList" doubleListKey="id" doubleListValue="name"  

  list="selectedtecherList" name="selectedtecherList" >
  </s:optiontransferselect>

 

就是要做一个右边选择框techerList显示所有的老师,然后从中选择一些老师到selectedtecherList

techerList是Action中找到的一个list,放在这里,页面访问是可以显示的,参数也可以拖动到selectedtecherList

selectedtecherList将会被我的action通过getter获得。

但是form提交不会进我的action方法,会被input拦截,我把input写了之后就报500错误:

org.apache.jasper.JasperException: Error on line 258, column 13 in template/simple/optiontransferselect.ftl
stack.findValue(parameters.doubleListKey) is undefined.
It cannot be assigned to doubleItemKey - Class: freemarker.core.Assignment
File: Assignment.java
Method: accept

怎么解决啊?关键是什么原因会导致这个问题的产生啊。。


------解决方案--------------------
这是Strut2的一个bug,Strut2有好几个令人不满意的地方,楼主可以看看我的博客。
  相关解决方案