[Struts] Newbie - For ActionForm population, must I use Struts taglib?

Discussion in 'Java' started by Pratap Das, Apr 3, 2004.

  1. Pratap Das

    Pratap Das Guest

    Hi,
    I'm a Struts newbie and I was hoping someone could help me with some
    of my doubts using this framework.

    1) I've been unable to populate my ActionForm with the request
    parameters on submit and after doing some googling I came upon a
    tutorial which said "you *must* use Struts tags (html:form, html:text,
    etc) to build your html page if you want to use ActionForms.

    I am not very convinced about this (because after all the final
    product on the browser is just an html page).

    So, my question is: Can I auto-populate a Struts ActionForm *without*
    using the struts tag libraries?

    2) My html form has a header section and detail section. The header
    section is straight forward however the detail section is basically a
    repeating row of html widgets.
    Eg: Name, Address etc goes into header section of the html page. Books
    owned, Title, Author, Pages etc (say, 1..50 rows) goes into the detail
    section of the html page.
    I wanted some advice on how I should go about designing an ActionForm.
    My current approach is to keep the header section simple like
    with methods like (pseudo code)
    public class MyActionForm extends ActionForm{
    //Header section
    String getName();
    String getAddress();

    //Detail section
    Collection getBookDetails();
    }

    The Collection is basically a Collection of BookDetail objects where
    BookDetail has getTitle(), getAuthor(), getPages() and so on.

    My Question: Can such an ActionForm be easily populated via struts
    tags (assuming that it is a *must* to auto-populate the ActionForm.)
    How can I achieve this?

    Thanks in advance for your help!
    --Das
     
    Pratap Das, Apr 3, 2004
    #1
    1. Advertising

  2. Pratap Das

    Sudsy Guest

    Re: [Struts] Newbie - For ActionForm population, must I use Strutstaglib?

    Pratap Das wrote:
    > Hi,
    > I'm a Struts newbie and I was hoping someone could help me with some
    > of my doubts using this framework.
    >
    > 1) I've been unable to populate my ActionForm with the request
    > parameters on submit and after doing some googling I came upon a
    > tutorial which said "you *must* use Struts tags (html:form, html:text,
    > etc) to build your html page if you want to use ActionForms.
    >
    > I am not very convinced about this (because after all the final
    > product on the browser is just an html page).


    You've already answered your own question. The HTML equivalent
    is a tag like this:
    <input type="TEXT" size="10" maxlength="10" value="value">
    The value is handled on the back-end by the framework.
    For more documentation, you might want to visit this
    URL: <http://www.selbyinc.com/technology/struts-arch.html>
    Use the back button provided at the bottom of the page and
    you will find additional information on other facets of
    using Struts.
     
    Sudsy, Apr 3, 2004
    #2
    1. Advertising

  3. Pratap Das

    Pratap Das Guest

    > You've already answered your own question. The HTML equivalent
    > is a tag like this:
    > <input type="TEXT" size="10" maxlength="10" value="value">
    > The value is handled on the back-end by the framework.


    Thanks for confirming this.

    > For more documentation, you might want to visit this
    > URL: <http://www.selbyinc.com/technology/struts-arch.html>
    > Use the back button provided at the bottom of the page and
    > you will find additional information on other facets of
    > using Struts.


    I'm sorry, but I'm unable to access this site (getting 404) - is this
    reproduced elsewhere?

    Thanks for your help!
    --Das
     
    Pratap Das, Apr 5, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sudsy
    Replies:
    0
    Views:
    532
    Sudsy
    Jul 3, 2003
  2. tom
    Replies:
    2
    Views:
    971
    code learner
    Dec 24, 2010
  3. Rode
    Replies:
    0
    Views:
    864
  4. PERCIVAL BRAGG
    Replies:
    0
    Views:
    559
    PERCIVAL BRAGG
    Oct 15, 2003
  5. sp

    Struts and actionForm

    sp, Jul 12, 2004, in forum: Java
    Replies:
    1
    Views:
    565
    Sudsy
    Jul 12, 2004
Loading...

Share This Page