html:options from a Collection of Strings

2001-07-30 Thread Warwick Boote

I've got a collection of strings, and i want to populat a html:options tage
with the values in that Collection.  where both the name and the value = the
string's value

this DOESN'T work:

  

  


Where fieldCodes is a Collection of Strings

It works ok if i wrap the elements in a bean that has getXXX and setXXX but
i don't realy want to do that.

Any help?

Waz.
=)





Re: html:options from a Collection of Strings

2001-07-30 Thread Bazoud Olivier

In subscription.jsp (webapp struts example), you can see :
...
<%
  java.util.ArrayList list = new java.util.ArrayList();
  list.add(new org.apache.struts.webapp.example.LabelValueBean("IMAP
Protocol", "imap"));
  list.add(new org.apache.struts.webapp.example.LabelValueBean("POP3
Protocol", "pop3"));
  pageContext.setAttribute("serverTypes", list);
%>
...
  

  
...



- Original Message -
From: "Warwick Boote" <[EMAIL PROTECTED]>
To: "Struts-User (E-mail)" <[EMAIL PROTECTED]>
Sent: Monday, July 30, 2001 5:28 PM
Subject: html:options from a Collection of Strings


> I've got a collection of strings, and i want to populat a html:options
tage
> with the values in that Collection.  where both the name and the value =
the
> string's value
>
> this DOESN'T work:
>
>   
> 
>   
>
>
> Where fieldCodes is a Collection of Strings
>
> It works ok if i wrap the elements in a bean that has getXXX and setXXX
but
> i don't realy want to do that.
>
> Any help?
>
> Waz.
> =)
>
>