• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to used Options Tag in Struts?

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
I have a Bean Class with List varibale and Getter and setter Method. The Code given below
public class ListBoxClass extends ActionForm {
private java.util.List TYPE_CDE;
public java.util.List getTYPE_CDE() {
return TYPE_CDE;
}
public void setTYPE_CDE(java.util.List newTYPE_CDE) {
TYPE_CDE = newTYPE_CDE;
}
}
List contain option Bean Class :-
public class OptionBean extends ActionForm {
private java.lang.String Name;
private java.lang.String Value;
public java.lang.String getName() {
return Name;
}
public java.lang.String getValue() {
return Value;
}
public void setName(java.lang.String newName) {
Name = newName;
}
public void setValue(java.lang.String newValue) {
Value = newValue;
}
}
In my Jsp,I have to use Options Tag and Display the List Box.How to Do this?
Pls Help me to solve this problem
Thanks
Balaji.M
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please review the html ptionsCollection tag and while you're at it look at the struts-defined LabelValueBean. You might want to create instances of that object inside your list and get rid of you name/value pair object.
Your form just needs the getter to return to List and your JSP (inside a html:select) just refers to the property.

Good Luck.
 
You don't know me, but I've been looking all over the world for. Thanks to the help from this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic