0

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.

2 Answers 2

1

Actually none of this. I have found I could use

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

try setting

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

or

<bean:define id="beanName" class="java.util.List" /> 
1
  • bean define does not allow to instantiate new beans. I have found I could use <jsp:useBean ../> for this. Sep 14, 2010 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.