Please help me to get knowledge about struts tags(html,bean,logic).

hai Friends,
I know basics of struts. I have done basic examples.
I have to know , how to get dynamic values in "view".
Instead of writing like this..
<html:select property="color1" size="4" >
<html:option value="red">red</html:option>
<html:option value="blue">blue</html:option>
<html:option value="green">green</html:option>
<html:option value="orange">orange</html:option>
<html:option value="red">red</html:option>
<html:option value="pink">pink</html:option>
</html:select>
How to use <html:options> tag to get dynamic values.
I have to get knowledge about this tags, so please suggest some
sites (or) send some materials (or) send some live examples("[email protected]"). It will very useful..
thanks friends....
take care...
bye.....
will be very useful for me...

you have to have a list of label and value pairs in you ActionForm then define it in your jsp to able able to use it in your <html:options> tag
ActionForm
public final class ColorForm extends ActionForm {
    public String color;
    public void setColor(String color) {
        this.color = color;
    public String getColor() {
        return this.color;
    public List getColorList() {
        List l = new ArrayList();
        ColorLabelValueBean lvRed = new ColorLabelValueBean();
        lv.setLabel("Red");
        lv.setValue("R");
        l.add(lv);
        ColorLabelValueBean lvGreen = new ColorLabelValueBean();
        lv.setLabel("Green");
        lv.setValue("G");
        l.add(lv);
        ColorLabelValueBean lvBlue = new ColorLabelValueBean();
        lv.setLabel("Blue");
        lv.setValue("B");
        l.add(lv);
        return l;
}Label - Value Bean
public final class ColorLabelValueBean implements Serializable {
    private String label;
    private String value;
    public void setLabel(String label) {
        this.label = label;
    public String getLabel() {
        return this.label;
    public void setValue(String value) {
        this.value = value;
    public String getValue() {
        return this.value;
}JSP
<bean:define id="colorListOption" name="ColorForm" property="colorList" type="java.util.List" />
<html:select property="color">
     <html:option value=""></html:option>
     <html:options collection="colorListOption" labelProperty="label" property="value" />
</html:select>
...Good luck!

Similar Messages

Maybe you are looking for

  • MacBook does not respond when I try to download files off the internet

    I have a MacBook OS X 10.5 Leopard and recently I have been trying to download and open things from the internet and they won't download. For example, I tried to download Safari (I have FireFox) and the box that says save file as... came up so I hit

  • How do I save files to external hard drive in anticipation of a OS clean install?

    How do I save files to an external hard drive in anticipation of a OS clean install?  I'm worried that the new OS will not be able to find my photos. My data have not been backed up for 2 months, and the OS is corrupted.  Currently working with a sen

  • Error while running adobe interactive form

    Hi, I made a scenario to update a z table using adobe interactive form in webdynpro.While executing I am getting the error as : Termination type was : RABAX_STATE Can anyone please guide me as to what can be the reason behind this error. Thanks in ad

  • EIS 6.2 Data load

    We are upgrading to EIS 6.2. I've set up an outline that mirrors our production outline and can perform a member load without errors. The data load also runs without errors, the problem is no data gets loaded. I have cut and paste the SQL query the E

  • E-mail re-setup

    I changed the password to my e-mail with AOL. I can not changed the password on my mac desktop, iphone or ipad so mail will start going there again? Any help. Thanks.