I'm implementing canonical in our wicket app and so I need to add a
canonical link to any page whose request has the ;jessionid=SESSIONID
parameter but NOT for those pages that don't have the jsessionid
parameter
 
Eg.,
 
If the page request was:
 
http://www.mydomain.com/page/aboutus;jsessionid=SESSIONID
 
then I need to output a canonical link with
 
http://www.mydomain.com/page/aboutus
 
as the reference but if the page request was for
 
http://www.mydomain.com/page/aboutus
 
then no canonical link should be provided because the request was for
the canonical page.
 
 
Is there a way in wicket to tell if the jsession parameter was provided
in the URL?
 
I've tried all the usual J2EE methods but it seems like it 'pre-strips'
the jsessionid and so I can't tell if it was present or not in the
original request.
 
I tried using isRequestedSessionIdFromURL
<http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/http/H
ttpServletRequest.html#isRequestedSessionIdFromURL%28%29>  but that
always seems to return false - probably because a cookie has already
been made available. I guess when the request is from a search engine no
cookies are enabled so isRequestedSessionIdFromURL would return true.
Possibly meaning that I've just answered my own question ;) but I
wouldn't mind confirming with others that the logic is correct.
 
Chris

Reply via email to