You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Mark <ma...@xeric.net> on 2011/02/25 22:24:46 UTC
session id
I am using:
Link link = pageRenderLinkSource.createPageRenderLinkWithContext("PageName",
pageContext);
To get a link to a page with a particular context that ties into a
Facebook share component. This has worked well, but now I'm
occasionally seeing it rendered with a jsessionid. Which of course I
do not want in order to share it on facebook.
It appears that that jsessionid started showing up once I started
securing certain pages of the application, but I'm not sure if that is
what is causing it.
Any idea on how to prevent these session ids from being part of the
links created in this manner?
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: session id
Posted by Josh Canfield <jo...@gmail.com>.
> It won't work, as the jsessionid is not a query parameter.
By that Thiago means that it's not a query parameter managed by the
Link, so you can't remove it. The jsessionid query parameter is added
by the servlet container when you call to*URI.
Josh
On Fri, Feb 25, 2011 at 3:43 PM, Thiago H. de Paula Figueiredo
<th...@gmail.com> wrote:
> On Fri, 25 Feb 2011 20:36:55 -0300, Mark <ma...@xeric.net> wrote:
>
>> Ah ok. That explains why I see it sometimes and not others. This is
>> what I ended up doing:
>>
>> Link link = pageRenderLinkSource.createPageRenderLinkWithContext("page",
>> context);
>> link.removeParameter("jsessionid");
>> return link;
>>
>> Any problems with that?
>
> It won't work, as the jsessionid is not a query parameter. Invoke one of the
> to*URI() methods and remove the jsessionid.
>
> --
> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: session id
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Fri, 25 Feb 2011 20:36:55 -0300, Mark <ma...@xeric.net> wrote:
> Ah ok. That explains why I see it sometimes and not others. This is
> what I ended up doing:
>
> Link link = pageRenderLinkSource.createPageRenderLinkWithContext("page",
> context);
> link.removeParameter("jsessionid");
> return link;
>
> Any problems with that?
It won't work, as the jsessionid is not a query parameter. Invoke one of
the to*URI() methods and remove the jsessionid.
--
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: session id
Posted by Mark <ma...@xeric.net>.
Ah ok. That explains why I see it sometimes and not others. This is
what I ended up doing:
Link link = pageRenderLinkSource.createPageRenderLinkWithContext("page",
context);
link.removeParameter("jsessionid");
return link;
Any problems with that?
Mark
On Fri, Feb 25, 2011 at 4:28 PM, Josh Canfield <jo...@gmail.com> wrote:
>> Any idea on how to prevent these session ids from being part of the
>> links created in this manner?
>
> You'll get a session id if you try to persist anything into the
> session, for instance if you use @ApplicationState as a page securing
> mechanisms might do.
>
> Tapestry calls encodeRedirectURL when you get the url out of the Link,
> if your application container uses url rewriting then it will append
> the jsessionid if the app server hasn't seen that cookies work.
>
> You could configure your app server to not do url rewriting, which may
> lead to things not working for users that don't want your cookies.
> or
> You could write a PageRenderLinkTransformer which returns a
> StatelessLink (copy LinkImpl and rename it) which never calls the
> encodeRedirectURL..
> or
> something else that isn't fresh off the top of my head!
>
> Good luck!
> Josh
>
> On Fri, Feb 25, 2011 at 1:24 PM, Mark <ma...@xeric.net> wrote:
>> I am using:
>>
>> Link link = pageRenderLinkSource.createPageRenderLinkWithContext("PageName",
>> pageContext);
>>
>> To get a link to a page with a particular context that ties into a
>> Facebook share component. This has worked well, but now I'm
>> occasionally seeing it rendered with a jsessionid. Which of course I
>> do not want in order to share it on facebook.
>>
>> It appears that that jsessionid started showing up once I started
>> securing certain pages of the application, but I'm not sure if that is
>> what is causing it.
>>
>> Any idea on how to prevent these session ids from being part of the
>> links created in this manner?
>>
>> Mark
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: session id
Posted by Josh Canfield <jo...@gmail.com>.
> Any idea on how to prevent these session ids from being part of the
> links created in this manner?
You'll get a session id if you try to persist anything into the
session, for instance if you use @ApplicationState as a page securing
mechanisms might do.
Tapestry calls encodeRedirectURL when you get the url out of the Link,
if your application container uses url rewriting then it will append
the jsessionid if the app server hasn't seen that cookies work.
You could configure your app server to not do url rewriting, which may
lead to things not working for users that don't want your cookies.
or
You could write a PageRenderLinkTransformer which returns a
StatelessLink (copy LinkImpl and rename it) which never calls the
encodeRedirectURL..
or
something else that isn't fresh off the top of my head!
Good luck!
Josh
On Fri, Feb 25, 2011 at 1:24 PM, Mark <ma...@xeric.net> wrote:
> I am using:
>
> Link link = pageRenderLinkSource.createPageRenderLinkWithContext("PageName",
> pageContext);
>
> To get a link to a page with a particular context that ties into a
> Facebook share component. This has worked well, but now I'm
> occasionally seeing it rendered with a jsessionid. Which of course I
> do not want in order to share it on facebook.
>
> It appears that that jsessionid started showing up once I started
> securing certain pages of the application, but I'm not sure if that is
> what is causing it.
>
> Any idea on how to prevent these session ids from being part of the
> links created in this manner?
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org