在嵌套的表单验证期间抛出异常:select(Struts 1.3.10)

时间:2012-05-22 09:08:20

标签: struts nested

我现在正在尝试深入研究struts框架,现在,我正在测试嵌套标签。我检索数据时遇到问题。我的代码如下:

            <nested:select property="formatDisponible">
                <logic:iterate id="listFormat" property="formatList" name="videoGameForm">
                <html:option value="${listFormat}" />
                </logic:iterate>
            </nested:select> 

当我执行验证操作时(我的意思是从我的表单中检索数据),我得到以下异常:

GRAVE: Method invocation failed. java.lang.IllegalArgumentException: java.lang.ClassCastException@110e3b5 at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

感谢您的帮助(我将向您提供有关任何更改的信息)。

我终于发现我以前的代码出了什么问题。如果不知何故,其他人面临同样的问题,我将在下面输入正确的代码。

            <nested:nest property="formatDisponible">
                <nested:select property="id">
                    <html:options collection="formatList" property="id" labelProperty="nom" labelName="id"></html:options>
                </nested:select>
            </nested:nest>

我纠正了我的第一次测试并最终得到了解决方案。我现在唯一想弄清楚的是如何设置选定的值(因为我使用此表单来更新我的对象)。如果我能解决它,我会更新我的帖子。

1 个答案:

答案 0 :(得分:0)

与此问题相关的所有问题都已解决(至少目前为止)。我不小心重载了select属性的值。

相关问题