• 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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

using dropdown box html:options example

 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Yes I guess so.

    ./pope

    PS: i am not an user of struts
     
    Ranch Hand
    Posts: 15304
    6
    Mac OS X IntelliJ IDE Chrome
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    This might help you out.
     
    If you believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!
    We need your help - Coderanch server fundraiser
    https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
    reply
      Bookmark Topic Watch Topic
    • New Topic