我继承了别人的代码,它使用的是OpenSymphony WebWorks,这是我以前从未遇到过的。我正试着对它进行“货运狂热”。它在JSP中包含以下内容:
<ww:select
name="'selectedOrigDoctypes'"
value="selectedOrigDoctypes"
size="5"
multiple="true"
cssClass="'doctype'"
list="origDoctypeChoices"
theme="'simple'" />我想不出如何从列表中取出所选的项目。该列表已正确填充Action bean的origDoctypeChoices属性的内容。我以为我只需要在Action bean中实现一个"setSelectedOrigDoctypes(List docTypes)“,但这并不起作用。相反,我在日志文件中看到了以下内容:
150876 [http-8080-1] DEBUG com.opensymphony.xwork.interceptor.ParametersIntercep
tor - Setting params {selectedOrigDoctypes=[Ljava.lang.String;@5249c469}
150965 [http-8080-1] DEBUG com.opensymphony.xwork.util.CompoundRootAccessor - No object in the CompoundRoot has a property named 'selectedOrigDoctypes'.发布于 2009-09-08 12:56:52
我终于弄明白了"selectedOrigDoctypes=[Ljava.lang.String;“是什么意思--我把"origDoctypeChoices”从一个列表变成了一个String[],一切都正常了。
https://stackoverflow.com/questions/1389115
复制相似问题