struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "hans albers" <super4...@hotmail.com>
Subject Where to put the code for filling an ArrayList
Date Mon, 03 Jun 2002 06:56:03 GMT
Hi there

I want a dropdown-box filled by a bean.

I fill the Arrraylist inside the jsp as you can see, but I don't
want to have this code in the jsp because the data later comes
from a database.
Where and how do I have to write this code (a...b) for the list be
accessed by the show.jsp?
In the showForm.java or showAction.java or in the Action.java of the
page before the show.jsp?

In my show.jsp:
<% //a
  java.util.ArrayList list = new java.util.ArrayList();
  list.add(new LabelValueBean("Art1", "a1"));
  list.add(new LabelValueBean("Art2", "a2"));
  list.add(new LabelValueBean("Art3", "a3"));
  session.setAttribute("my_list",list);
  // b
%>

--------
  <html:select property="value">
        <html:options collection="list" property="value"
          labelProperty="label"/>
  </html:select>

_________________________________________________________________
Testen Sie MSN Messenger für Ihren Online-Chat mit Freunden: 
http://messenger.msn.com


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message