You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Sam.Roberts" <sa...@inavero.com> on 2012/08/08 21:02:00 UTC

Tapestry get Post Data

I have a page that I am linking to from outside (a different webapp) to
Tapestry and I want to pass auth data and some other information along via
POST data rather than GET data, but I can't really figure out how to access
the POST data while in the onActivate for the page I'm going.

The closest answer to this that I've found by searching is from 2006 and
refers to HiveMind, which is certainly not up to date.

Thanks in advance.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-get-Post-Data-tp5715170.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry get Post Data

Posted by Howard Lewis Ship <hl...@gmail.com>.
To clarify, onActivate() is an event handler method, and
@RequestParameter is only honored for event handler methods.
beginRender(), afterRender(), etc. are render phase methods,
@RequestParameter would not work there.

On Wed, Aug 8, 2012 at 7:03 PM, Lance Java <la...@googlemail.com> wrote:
> You can also use @RequestParameter on parameters in render phase methods.
>
> eg
> void onActivate(@RequestParameter("foo") String foo) { ... }
>
> Normal tapestry coercion rules apply for types



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry get Post Data

Posted by Lance Java <la...@googlemail.com>.
You can also use @RequestParameter on parameters in render phase methods.

eg
void onActivate(@RequestParameter("foo") String foo) { ... }

Normal tapestry coercion rules apply for types

Re: Tapestry get Post Data

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 08 Aug 2012 16:02:00 -0300, Sam.Roberts <sa...@inavero.com>  
wrote:

> I have a page that I am linking to from outside (a different webapp) to
> Tapestry and I want to pass auth data and some other information along  
> via POST data rather than GET data, but I can't really figure out how to  
> access the POST data while in the onActivate for the page I'm going.

If the POST data is a query string, just @Inject Request and use  
Request.getParameter() as you would do with GET parameters. This is the  
same you used HttpServletRequest instead of Tapestry's Request. If not  
@Inject HttpServletRequest and follow the example in the answer to this  
question:  
http://stackoverflow.com/questions/3831680/httpservletrequest-get-post-data

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org