• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

options tag question

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
have two classes "Parent" and "Child"
as shown below.
class Parent
{
private ArrayList childList;
public void setChildList(ArrayList al)
{
childList = al;
}
public ArrayList getChildList()
{
return childList;
}
public boolean addChildToList(Child c)
{
return childList.add(c);
}
}
and i have another class Child
class Child
{
private String name;
public void setName(String nm)
{
name = nm;
}
public String getName()
{
return nm;
}
}
Lets assume that i have "parent" object in session. In my JSP page i want to have a drop
down of the names from the childList collection of parent class. How will I do it using JSTL.
<html options ..... > ?
Any help will be appreciated.
Thanks in advance.
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
use following way
<html ptions collection="parent" property="name" labelProperty="name" />
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic