开发者

Struts 1 - How to define List bean with empty value

开发者 https://www.devze.com 2023-01-15 08:16 出处:网络
I have Struts 1 / JSP web application. In the JSP I need to define List bean and pass value to it. <bean:define id=\"beanName\" type=\"java.util.List\" value=\"\"/>

I have Struts 1 / JSP web application. In the JSP I need to define List bean and pass value to it.

<bean:define id="beanName" type="java.util.List" value=""/>

does not work. It says I should pass in NNULL value.

<bean:define id="beanName" type="java.util.List" value=开发者_如何学编程"<%= new ArrayList() =>"/>

does not work either - it says it could accept only String type parameters.

Could someone point me out - how could I achieve this?

Thanks in advance for any suggestions.


Actually none of this. I have found I could use

<jsp:useBean id="beanName" type="java.util.ArrayList" beanName="java.util.ArrayList" scope="page" />


try setting

<bean:define id="beanName" class="java.util.List" value=""/> 

or

<bean:define id="beanName" class="java.util.List" /> 
0

精彩评论

暂无评论...
验证码 换一张
取 消