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]

Reply via email to