You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Edward Song <es...@royalmedia.com> on 2006/11/30 20:29:06 UTC
Retrieving DynaValidatorForm values with JSTL
Hi all,
I have a form stored within the session and am trying to dump some of the
Form values in the presentation using JSTL.
Specifically something like
Country : <c:out value="${sessionScope.SubscriptionProcessForm.country}"/>
The form's name is
SubscriptionProcessForm and the value to be retrieved from the form is
country.
Obviously I'm looking to retrieve the value without a scriptlet.
Is there a way?
Ed
RE: Retrieving DynaValidatorForm values with JSTL
Posted by Edward Song <es...@royalmedia.com>.
Wendy you're right!
<c:out value="${SubscriptionProcessForm.map.country}"/>
Thanks.
-----Original Message-----
From: Wendy Smoak [mailto:wsmoak@gmail.com]
Sent: Thursday, November 30, 2006 2:51 PM
To: Struts Users Mailing List
Subject: Re: Retrieving DynaValidatorForm values with JSTL
On 11/30/06, Edward Song <es...@royalmedia.com> wrote:
> In JSP pages using the Struts Taglib, attributes of DynaActionForm
> objects can be referenced just like ordinary ActionForm objects.
> Wherever a Struts tag refers to a "property", the tags will
> automatically use the DynaActionForm properties just like those of a
conventional JavaBean.
>
> So the code becomes
>
> <bean:write scope="session" name="SubscriptionProcessForm"
> property="country"/>
No... if you're using JSTL, don't go back to <bean:write>.
I meant this part:
The DynaActionForm properties must be accessed through a slightly different
syntax. The JSTL EL syntax for referencing a property of an ActionForm goes
like this:
${formbean.prop}
The syntax for referencing a property of a DynaActionForm would be:
${dynabean.map.prop}
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Retrieving DynaValidatorForm values with JSTL
Posted by Wendy Smoak <ws...@gmail.com>.
On 11/30/06, Edward Song <es...@royalmedia.com> wrote:
> In JSP pages using the Struts Taglib, attributes of DynaActionForm objects
> can be referenced just like ordinary ActionForm objects. Wherever a Struts
> tag refers to a "property", the tags will automatically use the
> DynaActionForm properties just like those of a conventional JavaBean.
>
> So the code becomes
>
> <bean:write scope="session" name="SubscriptionProcessForm"
> property="country"/>
No... if you're using JSTL, don't go back to <bean:write>.
I meant this part:
The DynaActionForm properties must be accessed through a slightly
different syntax. The JSTL EL syntax for referencing a property of an
ActionForm goes like this:
${formbean.prop}
The syntax for referencing a property of a DynaActionForm would be:
${dynabean.map.prop}
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Retrieving DynaValidatorForm values with JSTL
Posted by Edward Song <es...@royalmedia.com>.
Thank you Wendy
For all,
In JSP pages using the Struts Taglib, attributes of DynaActionForm objects
can be referenced just like ordinary ActionForm objects. Wherever a Struts
tag refers to a "property", the tags will automatically use the
DynaActionForm properties just like those of a conventional JavaBean.
So the code becomes
<bean:write scope="session" name="SubscriptionProcessForm"
property="country"/>
Thanks again.
Ed
-----Original Message-----
From: Wendy Smoak [mailto:wsmoak@gmail.com]
Sent: Thursday, November 30, 2006 2:35 PM
To: Struts Users Mailing List
Subject: Re: Retrieving DynaValidatorForm values with JSTL
On 11/30/06, Edward Song <es...@royalmedia.com> wrote:
> I have a form stored within the session and am trying to dump some of
> the Form values in the presentation using JSTL.
> Specifically something like
>
> Country : <c:out
> value="${sessionScope.SubscriptionProcessForm.country}"/>
See 4.3.1 on http://struts.apache.org/1.x/userGuide/building_controller.html
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Retrieving DynaValidatorForm values with JSTL
Posted by Wendy Smoak <ws...@gmail.com>.
On 11/30/06, Edward Song <es...@royalmedia.com> wrote:
> I have a form stored within the session and am trying to dump some of the
> Form values in the presentation using JSTL.
> Specifically something like
>
> Country : <c:out value="${sessionScope.SubscriptionProcessForm.country}"/>
See 4.3.1 on http://struts.apache.org/1.x/userGuide/building_controller.html
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org