dcsimg
Using different forms for input and output jsp with same action
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Praveen_Modukuri
Posted On:   Friday, April 22, 2005 05:59 AM

I have an input jsp which uses an inputForm and an output jsp

which uses outputForm.After the input jsp submits the form

the action class process the data and generates output

This output I want to be present in the outputForm

as it will be used in output jsp.I want to know how we can

achieve this in Struts as we generally have only one form

(mentioned in the action mapping) passed to the action class.


Should I integrate both the forms into a single form or is there any alternative method

Re: Using different forms for input and output jsp with same action

Posted By:   alan_do  
Posted On:   Friday, April 22, 2005 06:59 PM

uh...form POPULATION, not polution. :)

Re: Using different forms for input and output jsp with same action

Posted By:   alan_do  
Posted On:   Friday, April 22, 2005 10:27 AM

if both outputForm and inputForm are exactly the same. all you need to map you 2 actions to the same form. generally this is done for validation. 1 action mapping would have validate='false' (default) and the other would have validate='true'.


now your outputForm is different from the inputForm, you better off just have a viewbean defined for your output rather than have another struts ActionForm that is not going to be used by an action as intended (for form polution and validation). combining unrelated forms/beans as you suggested above will complicate your validations.


the only case that makes sense and you CAN get away with it is if you have multiple repeating fields in the form and the bean/form.

-/a

About | Sitemap | Contact