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

P

Pratap Das

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
 
S

Sudsy

Pratap said:
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.
 
P

Pratap Das

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top