Hi,

On Sun, Oct 23, 2011 at 11:10 PM, bjolletz <daniel.akerl...@pagero.com> wrote:
> Hi. I didn't get things to work with 1.5.2, seems to be the same behavior
> there.
>
> I've done some additional research and debugging... As far as I understand,
> my problem boils down to this:
>
> * Wicket creates a redirect from my StartPage (mounted as "App/StartPage")
> to my LoginPage (mounted as "LoginPage").
>
> * In the end of this redirect, wicket calls the sendRedirect(String
> location) method of the Response class of my web container, which in my case
> is org.apache.catalina.connector.Response (JBoss/Tomcat). As the location
> parameter, wicket sends "LoginPage".

This looks wrong. It should be "../LoginPage" instead.
But I'm not sure that Wicket creates this redirect location. From the
description in your first mail I think the web container (Tomcat)
should care about the redirect. I.e. hitting an Url that requires
authentication Tomcat will not deliver it to WicketFilter at all but
will do the redirect to the 'form-login-page'. I'm not sure how
exactly the web container does this though... If it is redirect 302
then all should be fine, but if it is RequestDispatcher.forward() then
Wicket will be confused indeed. See
https://issues.apache.org/jira/browse/WICKET-4138

>
> * Looking into the source code of org.apache.catalina.connector.Response, I
> can see that Tomcat treats this as a relative URL. Since the last URL
> visited was "App/StartPage", tomcat renders the redirect URL to be
> "App/LoginPage".
>
> * My browser receives the redirect and asks for the page App/LoginPage.
> Although this URL is wrong, wicket somehow seems to work out that LoginPage
> is the page to access, but no resources are loaded bacause of wrong URLs.
>
> I've tried mounting my LoginPage like:
>        mountPage("/LoginPage", LoginPage.class);
>
> But that attempt was futile, since it seems like wicket strips the "/" in
> the beginning of a mount URL.
>
> The question now is whether this is a wicket or a tomcat issue (or both, or
> none :) ). As far as I can see, if wicket called the
> org.apache.catalina.connector.Response with sendRedirect("/LoginPage"),
> things would work out. But there may well be many things I dont understand
> here...
>
> Bottom line...
> * Is my scenario meant to work?
> * Are my conclusions correct?
> * If so, should I create a JIRA case on this issue?
>
> Thanks for reading and your time!
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Wrong-path-for-resources-on-redirected-login-page-tp3920038p3931337.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



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

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

Reply via email to