Step 1 ------
You have to make your list of countries available, that is to say storing the list in a scope. You can do this in the action calling the page where are your combos.
example :
class Country
{
String iso_code;
String name;.... }
public class MyAction extends Action
{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
{
List c;// your code and the code to fill c
request.setAttribute("countries", c);
// your code
}
Step 2 : --------
In your jsp page,
<html:select property='country'>
<html:options collection="countries" property="iso_code" labelProperty="name" />
</html:select>
HTH,
Thomas
At 13:11 19/01/2004, you wrote:
Hi there,
I am new to Struts and I am wondering how can I handle the following situation: I have a form where I have some fields for entering user data. Some of the fields are combo boxes (<select> in html), for example a list of countries. My question is how can I fill the data in the countries combobox? Where should I store the data required for filling the combo? In the ActionForm or should I put it into another bean which is stored in the session or in the request? where should I fill the list with the countries in an Action class?
Thanks in advance,
Florin
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

