struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Tran" <dantt...@hotmail.com>
Subject Re: html:form quick question
Date Mon, 05 May 2003 00:58:13 GMT
Hi Brian, could you send me the jsp and struts config file
danttran@hotmail.com?

-Dan

----- Original Message ----- 
From: "brian jf" <brian_jf_275@hotmail.com>
To: <struts-user@jakarta.apache.org>
Sent: Sunday, May 04, 2003 5:45 PM
Subject: Re: html:form quick question


> Thanks again for the help Dan,
> but I don't understand what you mean
>
> >Your step 2 will not work unless the action in my.jsp >associate with
> >formA.
>
> This is already working. This is just outputting the values of formBeanA
> which gets populated by the action, onto the jsp. Nothing special here.
>
> I must not be making it clear.
> Sorry :-)
>
>
>
> >From: "Dan Tran" <danttran@hotmail.com>
> >Reply-To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> >To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> >Subject: Re: html:form quick question
> >Date: Sun, 4 May 2003 16:44:19 -0700
> >
> >Brian,
> >
> >Your step 2 will not work unless the action in my.jsp associate with
formA.
> >and Step 3 telling me your submit action has different form.
> >
> >I think what I suggested to you before is the solution.
> >
> >If you have any thing specific to that solution, I would be glad to help
> >
> >-Dan
> >
> >----- Original Message -----
> >From: "brian jf" <brian_jf_275@hotmail.com>
> >To: <struts-user@jakarta.apache.org>
> >Sent: Sunday, May 04, 2003 3:20 PM
> >Subject: Re: html:form quick question
> >
> >
> > > Hi Dan,
> > > sorry it's unclear. I think your answer is what I'm looking for, but
I'm
> >not
> > > sure how to do it using the taglibs. I'll try to make it clearer.
> > >
> > > 1) I call actionA
> > > 2) this forwards to my.jsp which outputs the values of the populated
> > > formBeanA
> > > 3) my.jsp also has a html:form which, when submitted calls actionB.
> > > formBeanB will get populated with the input values in the html:form.
> > >
> > > I want a property of formBeanB to be set, which is one of the values
of
> > > formBeanA.
> > >
> > > This should be a simple thing to do because all the values of
formBeanA
> >are
> > > in page scope of my.jsp, so surely you can forward a specific one to
the
> > > next action. This is my problem with struts! It is so difficult to
know
> >how
> > > to pass on attributes that are in page scope!
> > >
> > > I've tried something like this:
> > >
> > > <html:hidden name="formB property="formBparam" value="formAparam" />
> > >
> > >
> > > I've also tried defining the property that I want to forward in a
> > > bean:define tag
> > >
> > > <bean:define id="storeMe" name="formA" property="formAparam"/>
> > >
> > > None of these are quite working yet.
> > >
> > > Anyway, hope this makes it a bit more clear, and thanks very much for
> >all
> > > your help Dan.
> > > thanks,
> > > Brian
> > >
> > >
> > >
> > > >From: "Dan Tran" <danttran@hotmail.com>
> > > >Reply-To: "Struts Users Mailing List"
<struts-user@jakarta.apache.org>
> > > >To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> > > >Subject: Re: html:form quick question
> > > >Date: Sun, 4 May 2003 14:42:13 -0700
> > > >
> > > >Brian, I am little confused about what you are trying to do.
> > > >
> > > >Submitting a jsp form must associate with an action of the same form.
> > > >
> > > >Your have jsp with formA trying to submit with an action of another
> >form
> > > >(B)
> > > >.  That is not possible.
> > > >
> > > >
> > > >    What you can do is:
> > > >        - submit your JSP with an action(A) of form A,
> > > >        - in your actionA, retreive the interested property,
> > > >          save it to the request, and  forward it to  action B
> > > >        - in your actionB, retreive the save property in the
> > > >          request object in step 2, and copy it into   formB.
> > > >
> > > >hope this helps
> > > >
> > > >-Dan
> > > >
> > > >
> > > >
> > > >----- Original Message -----
> > > >From: "brian jf" <brian_jf_275@hotmail.com>
> > > >To: <struts-user@jakarta.apache.org>
> > > >Sent: Sunday, May 04, 2003 2:10 PM
> > > >Subject: Re: html:form quick question
> > > >
> > > >
> > > > >
> > > > > Hi Dan,
> > > > > thanks for the reply but I'm not
> > > > > really sure what you mean.
> > > > >
> > > > > Say I have two form beans - A and B.
> > > > > Lets say A has two String properties and
> > > > > B has two string properties.
> > > > >
> > > > > My jsp displays the two string properties
> > > > > of A, and has a html:form to call the
> > > > > action associated with form B. I want to
> > > > > set one form B's properties to be the
> > > > > value of one of form A's strings.
> > > > >
> > > > > I'm not really sure what your solution
> > > > > gives me. Perhaps you could explain?
> > > > > thanks,
> > > > > Brian
> > > > >
> > > > >
> > > > > >From: "Dan Tran" <danttran@hotmail.com>
> > > > > >Reply-To: "Struts Users Mailing List"
> ><struts-user@jakarta.apache.org>
> > > > > >To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> > > > > >Subject: Re: html:form quick question
> > > > > >Date: Sun, 4 May 2003 11:49:55 -0700
> > > > > >
> > > > > >You need a form which has both of  your original formA and form
B
> > > > > >properties.
> > > > > >
> > > > > >Let's call it formC
> > > > > >
> > > > > >actionA-->formC-->jspB where you can make display or hide
the
> >fields
> > > >any
> > > > > >which way you like.
> > > > > >
> > > > > >hope this helps.
> > > > > >
> > > > > >-Dan
> > > > > >----- Original Message -----
> > > > > >From: "brian jf" <brian_jf_275@hotmail.com>
> > > > > >To: <struts-user@jakarta.apache.org>
> > > > > >Sent: Sunday, May 04, 2003 11:24 AM
> > > > > >Subject: html:form quick question
> > > > > >
> > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Hi all,
> > > > > > >
> > > > > > > I've a quick html:form question.
> > > > > > >
> > > > > > > I have a jsp which, as the result of action A,
> > > > > > > outputs the values of the formBean A.
> > > > > > >
> > > > > > > However on the same page, I want to have a html:form which
> > > > > > > calls a different action (Action B) passing it lots of
user
> > > > > > > input for formBean B, but including a value from formBean
A.
> > > > > > >
> > > > > > > I've tried to do this with the html:hidden attribute but
> > > > > > > I'm not sure how to set the property of form B to be the
> > > > > > > inputted hidden value.
> > > > > > >
> > > > > > > Anyone able to help me out?
> > > > > > >
> > > > > > > At the moment, the relevant bits from the jsp look as follows:
> > > > > > >
> > > > > > >
> > > > > > > <html:form action="/actionB.do" method="post">
> > > > > > >
> > > > > > > <table>
> > > > > > > <tr>
> > > > > > > <td><bean:message key="action_b_input"/></td>
> > > > > > > <td><html:text name="bForm" property="someInput"
/></td>
> > > > > > > </tr>
> > > > > > >
> > > > > > > <tr>
> > > > > > > <td colspan="2" align="center">
> > > > > > > <html:image border="0" page="/submit.gif"/>
> > > > > > > </td>
> > > > > > > </tr>
> > > > > > > </table>
> > > > > > > <html:hidden name="aForm" property="somePropertyOfA"
/>
> > > > > > > </html:form>
> > > > > > >
> > > > > > >
> > > > > > > thanks very much,
> > > > > > > Brian
> > > > > > >
> > > > > > >
> >_________________________________________________________________
> > > > > > > Add photos to your messages with MSN 8. Get 2 months FREE*.
> > > > > > > http://join.msn.com/?page=features/featuredemail
> > > > > > >
> > > > > > >
> > > > > > >
> > > >---------------------------------------------------------------------
> > > > > > > To unsubscribe, e-mail:
> >struts-user-unsubscribe@jakarta.apache.org
> > > > > > > For additional commands, e-mail:
> >struts-user-help@jakarta.apache.org
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > >---------------------------------------------------------------------
> > > > > >To unsubscribe, e-mail:
struts-user-unsubscribe@jakarta.apache.org
> > > > > >For additional commands, e-mail:
> >struts-user-help@jakarta.apache.org
> > > > > >
> > > > >
> > > > >
> > > > > _________________________________________________________________
> > > > > The new MSN 8: advanced junk mail protection and 2 months FREE*
> > > > > http://join.msn.com/?page=features/junkmail
> > > > >
> > > > >
> > > > >
> >---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > > > For additional commands, e-mail:
struts-user-help@jakarta.apache.org
> > > > >
> > > > >
> > > >
> > > >---------------------------------------------------------------------
> > > >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > >For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > > >
> > >
> > >
> > > _________________________________________________________________
> > > Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> > > http://join.msn.com/?page=features/featuredemail
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> > >
> > >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
> _________________________________________________________________
> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
> http://join.msn.com/?page=features/virus
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

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


Mime
View raw message