Re: 301 vs 302 redirects due to SEO
Lutz Hühnken wrote: > > See > http://old.nabble.com/T5-How-to-tell-T5-to-send-301-%28moved-permanently%29-ts18870223.html > Herzlichen Dank! Stephan - -- http://www.caimito.net - Caimito One Team - Agile Collaboration and Planning tool http://www.stephan-schwab.com - Personal blog http://code.google.com/p/tapestry-sesame - Authentication extension for Tapestry 5 -- View this message in context: http://old.nabble.com/301-vs-302-redirects-due-to-SEO-tp27165953p27191977.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: 301 vs 302 redirects due to SEO
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 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
301 vs 302 redirects due to SEO
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 - -- http://www.caimito.net - Caimito One Team - Agile Collaboration and Planning tool http://www.stephan-schwab.com - Personal blog http://code.google.com/p/tapestry-sesame - Authentication extension for Tapestry 5 -- View this message in context: http://old.nabble.com/301-vs-302-redirects-due-to-SEO-tp27165953p27165953.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org