You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ian Marshall <Ia...@GMail.com> on 2012/02/14 11:22:00 UTC

Link URLs (with JSessionID) truncated during URL rewriting

Hello All,

Has anyone else apart from me suffered from this problem of URLs being
truncated to become invalid?

I would appreciate it if anyone else shared my pain!

Ian Marshall


Ian Marshall wrote
> 
> Hello All,
> 
> A user's first visit to my app's home page results in the URL
> 
>   http://[My domain]/main/PageHome;jsessionid=v_qqIGVQlKBbkNSOcHkAQw?0
> 
> Each org.apache.wicket.markup.html.link.Link on my home page has the URL
> of the form
> 
>   http://[My
> domain]/main/..;jsessionid=v_qqIGVQlKBbkNSOcHkAQw?0-1.ILinkListener-lnkAbout
> 
> (of length 102 characters for the particular link URL copied here). These
> URLs are invalid, because of the two dots present instead of the completed
> path.
> 
> Is there any way I can configure Wicket to suppress this URL abbreviation,
> or is this operation the province of the web application server or web
> browser?
> 
> As a work-around, I have already coded the supression of JSessionIDs in my
> links' URLs, and am coding the app to give a warning if session cookies
> are disabled. But I would appreciate any pointers.
> 
> Ian Marshall
> 
> 
> My operating environment
> -------------------------
> Web application server: (Jetty? in) Google App Engine
> Wicket version:         1.5.3 (I know: it's not the very latest version!)
> Web browsers:           Mozilla Firefox 10.0.1
>                         Microsoft Internet Explorer 8.0.6001.18702
>                         as found on my HTC Wildfire S running Google
> Android 2.3.5
> 

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Link-URLs-with-JSessionID-truncated-tp4381881p4386619.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Link URLs (with JSessionID) truncated during URL rewriting

Posted by Bartosz Jakubowski <bu...@wp.pl>.
I use Jetty 6.1.26 and this patch works fine for me. Thanks.

On 23.02.2012 16:23, Ian Marshall wrote:
> I run my Wicket app on Google App Engine for Java, which I believe uses Jetty
> (or modified Jetty?) not Tomcat as its web application server.
>
> The JIRA ticket states
>
>    "The bug does only show up when using tomcat (6.0.29) and not in jetty",
>
> so I'll dip out of testing this particular ticket if that's OK.
>
>
> Martin Grigorov-4 wrote
>> https://issues.apache.org/jira/browse/WICKET-4401
>> There is a patch attached to this ticket. Try it and send feedback.
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Link-URLs-with-JSessionID-truncated-tp4381881p4414160.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>


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


Re: Link URLs (with JSessionID) truncated during URL rewriting

Posted by Ian Marshall <Ia...@GMail.com>.
I run my Wicket app on Google App Engine for Java, which I believe uses Jetty
(or modified Jetty?) not Tomcat as its web application server.

The JIRA ticket states

  "The bug does only show up when using tomcat (6.0.29) and not in jetty",

so I'll dip out of testing this particular ticket if that's OK.


Martin Grigorov-4 wrote
> https://issues.apache.org/jira/browse/WICKET-4401
> There is a patch attached to this ticket. Try it and send feedback.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Link-URLs-with-JSessionID-truncated-tp4381881p4414160.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Link URLs (with JSessionID) truncated during URL rewriting

Posted by Martin Grigorov <mg...@apache.org>.
On Thu, Feb 23, 2012 at 4:09 PM, Bartosz Jakubowski <bu...@wp.pl> wrote:
> I've had the same issue. It happens when you have mounted home page to "/"
> and another page Foo to "/foo". Then the URL with jsessionid looks like
> this: /foo/..;jsessionid and the mapper of page Foo takes it as if it is a
> URL to this page with parameter "..". And this mapper always goes before
> home page mapper, because it has score 1 for matching first segment.
>
> I fixed it by overloading newWebRequest in Application class:
>
>     protected WebRequest newWebRequest(HttpServletRequest servletRequest,
>            String filterPath) {
>        WebRequest webRequest = super.newWebRequest(servletRequest,
> filterPath);
>        return new ServletWebRequest(servletRequest, filterPath,
> webRequest.getUrl().canonical());
>    }

https://issues.apache.org/jira/browse/WICKET-4401
There is a patch attached to this ticket. Try it and send feedback.



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: Link URLs (with JSessionID) truncated during URL rewriting

Posted by Bartosz Jakubowski <bu...@wp.pl>.
I've had the same issue. It happens when you have mounted home page to 
"/" and another page Foo to "/foo". Then the URL with jsessionid looks 
like this: /foo/..;jsessionid and the mapper of page Foo takes it as if 
it is a URL to this page with parameter "..". And this mapper always 
goes before home page mapper, because it has score 1 for matching first 
segment.

I fixed it by overloading newWebRequest in Application class:

      protected WebRequest newWebRequest(HttpServletRequest servletRequest,
             String filterPath) {
         WebRequest webRequest = super.newWebRequest(servletRequest, 
filterPath);
         return new ServletWebRequest(servletRequest, filterPath, 
webRequest.getUrl().canonical());
     }

Re: Link URLs (with JSessionID) truncated during URL rewriting

Posted by Ian Marshall <Ia...@GMail.com>.
I fixed the problem by going around it.

All my web pages are descended from my PageBase class, which in turn
descends from Wicket's WebPage.

  ·  I disable my automatic removal of JSessionID by overriding

       public String ServletWebResponse.encodeURL(CharSequence url)

     in my WebApplication.

  ·  In my PageBase constructor, I determine whether (session) cookies are
     detected are being stored or not.

  ·  If not, then I raise an

       org.apache.wicket.RestartResponseException(final Class<C> pageClass)

     to show my PageCookiesDisabled. This interrupts a "Not found" error
from
     an invalid URL containing ".." characters, which I encountered
previously.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Link-URLs-with-JSessionID-truncated-tp4381881p4414037.html
Sent from the Users forum mailing list archive at Nabble.com.

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