What do you mean by "does not seem to work"?  Do you get null values? NPE?

Is your ActionFormA still in scope (available) in SetupActionB?  In other words, can 
you get a non-null value for either of

  request.getAttribute("ActionFormA.key");

or
 
  session.getAttribute("ActionFormA.key");

Sri
-----Original Message-----
From: Susan Bradeen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 18, 2003 3:23 PM
To: [EMAIL PROTECTED]
Subject: Using different actionform types before and after a display page.


I normally use the same *type* of action form before and after my jsp 
pages, but what if the jsp submits to an action that uses a different type 
of action form, but contains a few of the same fields that I'd like to use 
in that second action? Can I retrieve the submitted values (coming from 
one action form type) to use in an action with a different action form 
type?

Too confusing? :-)

If I have ... 
   SetupActionA, using its ActionformA, to display A.jsp
and ... 
   SetupActionB, using its ActionformB, to display B.jsp

Now say that my A.jsp contains a form that submits to SetupActionB. 

If the ActionformA and the ActionformB contain a few identical fields, is 
it correct that the parameters submitted from A.jsp can be retrieved and 
used by my ActionformB in the SetupActionB? 

public class SetupActionA extends Action {
    public ActionForward execute(...) throws Exception {
        ActionformA formA = (ActionformA) form;
       formA.setMyID(someID);
       formA.setMyName(someName);
      ... etc
   }
}
 
public class SetupActionB extends Action {
    public ActionForward execute(...) throws Exception {
        ActionformB formB = (ActionformB) form;
       formB.setMyID(*** get this from the A.jsp parameters ***);
       formA.setMyName(*** get this from the A.jsp parameters ***);
      ... etc
   }
}

My tests so far have been unsuccessful, especially for <html:hidden> field 
values. I know that I can use request.getParameter("myID"), for values 
submitted by the html form, but this does not seem to work for 
<html:hidden> fields. 

I think I am getting tripped up by an elementary Struts concept 
(ActionForm instances?), but my brain seems to be up against a brick wall 
at the moment. 

Thanks for any clarification.

Susan Bradeen
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to