You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Balkan Guler <ce...@gmail.com> on 2005/08/13 16:49:42 UTC
actionForm class
Hello.
There is something I could not understand with actionForms.
Suppose that I have 2 pages and a action.
In first page I want to take student number and call the business objects in
action to fetch the student details from database and show them in the
second page.
there is a studentNumberForm declared in the action-mapping block with the
studentAction. So struts will fill the studentNumber field of the
studentNumberForm with the first page parameter and send it to the
studentAction.
The question is after taking the student detail from DB where will I place
them to show in the last page? There is only one action form...
Re: actionForm class
Posted by Sebastian Hennebrueder <us...@laliluna.de>.
Balkan Guler schrieb:
>Hello.
> There is something I could not understand with actionForms.
> Suppose that I have 2 pages and a action.
>In first page I want to take student number and call the business objects in
>action to fetch the student details from database and show them in the
>second page.
> there is a studentNumberForm declared in the action-mapping block with the
>studentAction. So struts will fill the studentNumber field of the
>studentNumberForm with the first page parameter and send it to the
>studentAction.
> The question is after taking the student detail from DB where will I place
>them to show in the last page? There is only one action form...
>
>
>
a)
You may use hidden fields in the different pages
b)
Save the values or the complete actionForm in the session
--
Best Regards / Viele Grüße
Sebastian Hennebrueder
----
http://www.laliluna.de
Tutorials for JSP, JavaServer Faces, Struts, Hibernate and EJB
Get support, education and consulting for these technologies - uncomplicated and cheap.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: actionForm class
Posted by Nafise Dianatizade <n_...@yahoo.com>.
at the whole you need a DTO(Data Transfer Object) for transferring the student fetched data to the jsp page. So you could specify an object for this purpose or use your predefine actionForm object.
you could use bean:write for both specified DTO and ActionForm object to display the information on the page. but if you are using ActionForm object, there's another option using form tag and the inner tags such as html:text to display its properties.
Nafise
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Re: actionForm class
Posted by Richard Yee <ry...@cruzio.com>.
Balkan,
The values retrieved from the database don't need to be put into an
ActionForm. Just put the collection or bean as a session or request
attribute in your Action class, forward to your second page, and then
retrieve the values and display them. There is no need to have an
ActionForm associated with your second page. ActionForms are mainly used
when you are taking form input from a page.
-Richard
At 07:49 AM 8/13/2005, you wrote:
>Hello.
> There is something I could not understand with actionForms.
> Suppose that I have 2 pages and a action.
>In first page I want to take student number and call the business objects in
>action to fetch the student details from database and show them in the
>second page.
> there is a studentNumberForm declared in the action-mapping block with the
>studentAction. So struts will fill the studentNumber field of the
>studentNumberForm with the first page parameter and send it to the
>studentAction.
> The question is after taking the student detail from DB where will I place
>them to show in the last page? There is only one action form...
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org