struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Maier <Marco.Ma...@ics-software.de>
Subject Two ActionForms in one action
Date Thu, 01 Aug 2002 08:09:50 GMT
Hi,

is it possible to preset a form in an action that is associated with 
another form.

For example:
I have the action Action1 with the name attribute Form1

public class Action1 extends Action
{
[...]

public ActionForward execute(ActionMapping mapping, ActionForm form,
        		HttpServletRequest request, HttpServletResponse response
	  )	
throws Exception
{
   // get values from form1
   Form1 form1 = (Form1) form;
   	
   System.out.println("Day: " + form1.getDay());
   System.out.println("Month: " + form1.getMonth());
   System.out.println("Year: " + form1.getYear());
   [...]
   // put values to business layer
   [...]
   // get results from business layer
   [...]

   // set results to another form (for example Form2)
   Form2 form2 = new Form2();
  	
   form2.setSomething("Hello");	
   [...]

   // forward to Action2 that is associated with Form2
   return mapping.findForward(RPKConstants.SUCCESS_KEY);
}
}

In Action2 I will get the preset values from Form2.
How does my action-mapping looks like
if this is possible?
Are there any alternatives?

TIA,
Marco






--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message