You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by gs_tapestry <si...@gallerysystems.com> on 2012/04/05 19:25:06 UTC

Switch Locale with cookie disabled

Hi,

I am customizing an Tapestry 5.1 based application to make it SEO compliant.
We have a working switch locale function.  We use PersistentLocale in our
implementation. Since PersistentLocale is Cookie-based, it stops working
when we disable browser cookie ( a requirement for SEO).  

My question is how to implement switching locale in Tapestry with cookie
disabled.

Thanks,
Simon

--
View this message in context: http://tapestry.1045711.n5.nabble.com/Switch-Locale-with-cookie-disabled-tp5620967p5620967.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: Switch Locale with cookie disabled

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Sat, 07 Apr 2012 05:22:09 -0300, Lance Java <la...@googlemail.com>  
wrote:

> This thread might be of interest too
> http://tapestry.1045711.n5.nabble.com/Dynamic-CSS-depending-on-URL-td5595488.html

The original poster is using a Tapestry 5 alpha version that doesn't have  
any of the features used in the solutions proposed in that thread.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Re: Switch Locale with cookie disabled

Posted by Lance Java <la...@googlemail.com>.
This thread might be of interest too
http://tapestry.1045711.n5.nabble.com/Dynamic-CSS-depending-on-URL-td5595488.html


On 6 April 2012 14:34, Thiago H. de Paula Figueiredo <th...@gmail.com>wrote:

> On Thu, 05 Apr 2012 23:48:02 -0300, gs_tapestry <si...@gallerysystems.com>
> wrote:
>
>  Thiago,
>>
>
> Hi!
>
>  Please advise.
>>
>
> Upgrade. You're using a years-old alpha version of Tapestry, which misses
> a huge number of bug fixes and new features.
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Switch Locale with cookie disabled

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 05 Apr 2012 23:48:02 -0300, gs_tapestry  
<si...@gallerysystems.com> wrote:

> Thiago,

Hi!

> Please advise.

Upgrade. You're using a years-old alpha version of Tapestry, which misses  
a huge number of bug fixes and new features.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


RE: Switch Locale with cookie disabled

Posted by gs_tapestry <si...@gallerysystems.com>.
Thiago,

Thank you. I am able to add locale to query parameter and retrieved. But I can’t use PersistentLocale as it is cookie-based.  I made a mistake in my post.  I am using Tapestry5.0.16 and don’t have those classes you mentioned.  I implemented a localeRequestFitler (based an old post in this forum) and contribute it to both CompentEventRequestHandler and PageRenderRequestHandler. (There is no ComponentRequestHandler). It’s being called as expected and I use LocaleSetting.setLocale method to set the new locale. But it isn’t picked up by Tapestry while getMessage is called.
As mentioned, there are no LinkCreationListener and LinkCreatinHub class in T5.0 either. Please advise.

Thanks,
Simon


From: Thiago H de Paula Figueiredo [via Tapestry] [mailto:ml-node+s1045711n5621191h26@n5.nabble.com]
Sent: Thursday, April 05, 2012 2:49 PM
To: Simon Zeng
Subject: Re: Switch Locale with cookie disabled

On Thu, 05 Apr 2012 14:25:06 -0300, gs_tapestry
<[hidden email]</user/SendEmail.jtp?type=node&node=5621191&i=0>> wrote:

> Hi,

Hi!

> I am customizing an Tapestry 5.1 based application to make it SEO
> compliant. We have a working switch locale function.  We use
> PersistentLocale in our
> implementation. Since PersistentLocale is Cookie-based, it stops working
> when we disable browser cookie ( a requirement for SEO).
> My question is how to implement switching locale in Tapestry with cookie
> disabled.

Tapestry 5.2+ has the option of adding the locale to the URL
automatically. In 5.1, you can implement a LinkCreationListener,
contributed to the LinkCreatinHub service, that adds a query parameter
with the locale and a ComponentRequestFilter, contributed to the
ComponentRequestHandler, to get this query parameter and set the
PersistentLocale accordingly. Or, instead of a LinkCreationListener, you
could use URL rewriter so you can avoid query parameters.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]</user/SendEmail.jtp?type=node&node=5621191&i=1>
For additional commands, e-mail: [hidden email]</user/SendEmail.jtp?type=node&node=5621191&i=2>


________________________________
If you reply to this email, your message will be added to the discussion below:
http://tapestry.1045711.n5.nabble.com/Switch-Locale-with-cookie-disabled-tp5620967p5621191.html
To unsubscribe from Switch Locale with cookie disabled, click here<http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5620967&code=c2ltb256QGdhbGxlcnlzeXN0ZW1zLmNvbXw1NjIwOTY3fDQzNDc4OTY5MQ==>.
NAML<http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


--
View this message in context: http://tapestry.1045711.n5.nabble.com/Switch-Locale-with-cookie-disabled-tp5620967p5621945.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: Switch Locale with cookie disabled

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 05 Apr 2012 14:25:06 -0300, gs_tapestry  
<si...@gallerysystems.com> wrote:

> Hi,

Hi!

> I am customizing an Tapestry 5.1 based application to make it SEO  
> compliant. We have a working switch locale function.  We use  
> PersistentLocale in our
> implementation. Since PersistentLocale is Cookie-based, it stops working
> when we disable browser cookie ( a requirement for SEO).
> My question is how to implement switching locale in Tapestry with cookie
> disabled.

Tapestry 5.2+ has the option of adding the locale to the URL  
automatically. In 5.1, you can implement a LinkCreationListener,  
contributed to the LinkCreatinHub service, that adds a query parameter  
with the locale and a ComponentRequestFilter, contributed to the  
ComponentRequestHandler, to get this query parameter and set the  
PersistentLocale accordingly. Or, instead of a LinkCreationListener, you  
could use URL rewriter so you can avoid query parameters.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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