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
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