Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using dropdown box html:options example

 
ashish kulkarni
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Can some on provide a example of using <html ptions
in jsp,
how to define the in struts-config.xml file, how to
populate the data in Action class and then display it
on jsp page,
Also how to retain this data in request for other
request,
For example , suppose the user hits enter to submit
the data Action class which process the data, and if
there is any error, display back the jsp with the
error message, and all the values in dropdown box with
the value selected by user selected in option
I have seen the examples provided by struts, but it is
not clear how to use it with Action class
Ashish
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are some links that may help you starting:
  • Learn Struts' Form-Related Tags
  • Struts Tutorial
  • html options


  • ./pope
     
    ashish kulkarni
    Ranch Hand
    Posts: 131
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi
    Thanx for the reply,
    suppose i have a class like this
    public class MyClass
    private String name;
    private String age;
    public String getName()
    {
    return name;
    }
    public String setName(String name)
    {
    this.name = name
    }

    public String getAge()
    {
    return age;
    }
    public String setAge(String age)
    {
    this.age= age
    }

    Can i use this, instead of org.apache.struts.util.LabelValueBean?
    Also i have defined a DynaValidatorForm
    <form-bean dynamic="true" name="VendorItemMappingForm" type="org.apache.struts.validator.DynaValidatorForm">
    <form-property name="vendorbean" type="java.util.ArrayList" />
    </form-bean>
    In my action class i pouplate vendorbean with MyClass,
    can i access it in my jsp
    I am bot able to do this


    Ashish
     
    Alexandru Popescu
    Ranch Hand
    Posts: 995
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Yes I guess so.

    ./pope

    PS: i am not an user of struts
     
    Gregg Bolinger
    GenRocket Founder
    Ranch Hand
    Posts: 15302
    6
    Chrome IntelliJ IDE Mac OS X
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    This might help you out.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic