Stephan,

you can extend the possible return types of the onActivate method by
adding a ComponentEventResultProcessor to you configuration. You can
define an HttpStatusCode class that returns the code you wish.

I don't know if you consider this "clean", but it takes HTTP
internals, codes etc. out of you page class and puts it into the
HttpStatusCode class or the result processor.

See 
http://old.nabble.com/T5-How-to-tell-T5-to-send-301-%28moved-permanently%29-ts18870223.html

Hope this helps,

Lutz


On Thu, Jan 14, 2010 at 7:28 PM, Stephan Schwab <s...@caimito.net> wrote:
>
> Event handlers in Tapestry, such as onActivate() may return a page object or
> page name. That gets translated into a HTTP 302 redirect.
>
> Now there are situations, e.g. in shopping applications, where one needs to
> use 301 (moved permanently) redirects instead.
>
> One can @Inject the Response object, set the status to 301 and the location
> in the HTTP header. That works but it makes you mix framework code with
> application code in a page class which feels a bit wrong.
>
> Is there a cleaner way?
>
> Stephan
>




-- 
altocon GmbH
http://www.altocon.de/
Software Development, Consulting
Hamburg, Germany

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

Reply via email to