You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Al Sutton <al...@funkyandroid.com> on 2009/02/27 08:37:08 UTC

Potential bug/dumb mistake with a href, s:url, and s:property

I've just come across something which may be a bug, or may just be 
accepted as a dumb way of doing things an not a worry.

Using tomcat and URL rewriting for sessions if you put;

<a href="<s:url value='/linkto'/>/<s:property value='myobject.id'/>"> 
Blah </a>

The link ends up as;

http://server/apppath/linkto;jessionid=2389712798321/objectId

So that when the user clicks on it the end up at 
http://server/apppath/linkto which is not where the developer originally 
inteneded

However, if I do;

<a href="<s:url value='/linkto/%{myobject.id}'/>"> Blah </a>

The link ends up as;

http://server/apppath/linkto/objectId;jessionid=2389712798321

which takes the user to the right place.

I couldn't find a note saying "Don't do this" anywhere, should the wiki 
be updated, or should I wear my "I am dumb" hat today?

Al.

-- 

* Written an Android App? - List it at http://andappstore.com/ *

======
Funky Android Limited is registered in England & Wales with the 
company number  6741909. The registered head office is Kemp House, 
152-160 City Road, London,  EC1V 2NX, UK. 

The views expressed in this email are those of the author and not 
necessarily those of Funky Android Limited, it's associates, or it's 
subsidiaries.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Potential bug/dumb mistake with a href, s:url, and s:property

Posted by Al Sutton <al...@funkyandroid.com>.
dumb hat day it is then :).

At least it's Friday.

Al.

Dave Newton wrote:
> Al Sutton wrote:
>> However, if I do;
>>
>> <a href="<s:url value='/linkto/%{myobject.id}'/>"> Blah </a>
>>
>> The link ends up as;
>>
>> http://server/apppath/linkto/objectId;jessionid=2389712798321
>>
>> which takes the user to the right place.
>>
>> I couldn't find a note saying "Don't do this" anywhere, should the 
>> wiki be updated, or should I wear my "I am dumb" hat today?
>
> There should probably be a note somewhere, but once that URL tag is 
> closed IMO the URL should be considered formed, and adding anything 
> else to it runs that session ID risk.
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>


-- 

* Written an Android App? - List it at http://andappstore.com/ *

======
Funky Android Limited is registered in England & Wales with the 
company number  6741909. The registered head office is Kemp House, 
152-160 City Road, London,  EC1V 2NX, UK. 

The views expressed in this email are those of the author and not 
necessarily those of Funky Android Limited, it's associates, or it's 
subsidiaries.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Potential bug/dumb mistake with a href, s:url, and s:property

Posted by Dave Newton <ne...@yahoo.com>.
Al Sutton wrote:
> However, if I do;
> 
> <a href="<s:url value='/linkto/%{myobject.id}'/>"> Blah </a>
> 
> The link ends up as;
> 
> http://server/apppath/linkto/objectId;jessionid=2389712798321
> 
> which takes the user to the right place.
> 
> I couldn't find a note saying "Don't do this" anywhere, should the wiki 
> be updated, or should I wear my "I am dumb" hat today?

There should probably be a note somewhere, but once that URL tag is 
closed IMO the URL should be considered formed, and adding anything else 
to it runs that session ID risk.

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org