You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "SANSONE, AARON M [Non-Pharmacia/1000]" <aa...@monsanto.com> on 2001/10/15 23:20:47 UTC
Placing Request Values on the Session...
I need a simple way to place posted values from a form on the user session
for later use. I thought that the SessionPropagatorAction was the way to
go. Is anyone using the SessionPropagatorAction successfully in this
manner?
I have a form that posts three values (text input "varOne", "varTwo" and
"varThree") to a matching pattern in sitemap.xmap which then calls the
session-propagator action to (theoretically) place posted the values on the
session:
<map:match pattern="getCAParms">
<map:act type="session-propagator">
<map:parameter name="varOne" value="{varOne}"/>
<map:parameter name="varTwo" value="{varTwo}"/>
<map:parameter name="varThree" value="{varThree}"/>
</map:act>
</map:match>
Obviously this doesn't do what I would have expected it to.
I must be going about this in the wrong way, does anyone have a better
solution?
Thanks,
Aaron
(Cocoon 2rc1a, JRun 3.1, NT4)
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Placing Request Values on the Session...
Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 15.Oct.2001 -- 04:20 PM, SANSONE, AARON M [Non-Pharmacia/1000] wrote:
> I need a simple way to place posted values from a form on the user session
> for later use. I thought that the SessionPropagatorAction was the way to
> go. Is anyone using the SessionPropagatorAction successfully in this
> manner?
>
> I have a form that posts three values (text input "varOne", "varTwo" and
> "varThree") to a matching pattern in sitemap.xmap which then calls the
> session-propagator action to (theoretically) place posted the values on the
> session:
>
> <map:match pattern="getCAParms">
> <map:act type="session-propagator">
> <map:parameter name="varOne" value="{varOne}"/>
> <map:parameter name="varTwo" value="{varTwo}"/>
> <map:parameter name="varThree" value="{varThree}"/>
> </map:act>
> </map:match>
>
> Obviously this doesn't do what I would have expected it to.
>
> I must be going about this in the wrong way, does anyone have a better
> solution?
Aaron,
what you're missing here is, that {varOne} can't be substituted with
the desired value because Cocoon doesn't know about it. Put another
action around the session-propagator, namely the "RequestParamAction"
and set "parameters" to "true". Thus
<map:match pattern="getCAParms">
<map:act type="request">
<map:parameter name="parameters" value="true"/>
<map:parameter name="default.varOne" value="some default value for varOne"/>
<map:act type="session-propagator">
<map:parameter name="varOne" value="{varOne}"/>
<map:parameter name="varTwo" value="{varTwo}"/>
<map:parameter name="varThree" value="{varThree}"/>
</map:act>
</map:act>
</map:match>
HTH
Chris.
--
C h r i s t i a n H a u l
haul@informatik.tu-darmstadt.de
fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>