dynamic form for struts

Discussions

Web tier: servlets, JSP, Web frameworks: dynamic form for struts

  1. dynamic form for struts (2 messages)

    Hi all

    I have a dynamic form which has a series textfield.

    the name of the textfields like "text1", "text2", "text3",.. ,etc.

    I am not sure how many textfields do i have. (as they looped from sql)

    I use strut form bean, I have no idea about how to get these kind of textfield value.

    private String text1;
    private String text2;
    .
    .
    .

    pls help, thanks

    Regards,

    Kin

    Threaded Messages (2)

  2. dynamic form for struts[ Go to top ]

    Kin,
       You should use a mapped form or indexed form:

    http://struts.apache.org/faqs/indexedprops.html

    There is lots of information on the web for this topic.

    Trevor
  3. Article[ Go to top ]

    Here's three articles that should help you understand DynaForms better:

    http://www.developer.com/java/ent/article.php/2214681
    http://www.developer.com/java/ent/article.php/2233591

    And here's something you might find interesting if you ever need it:
    http://www.developer.com/java/ejb/article.php/3321521