You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jeremy Levy <je...@meetmoi.com> on 2007/10/16 16:29:06 UTC

possible bug in 1.2.6 / 1.3 Include

I found this while working on 1.2.6 and checked it out in 1.3 and it's the
same. It appears as though Include does not pay attention to the contextpath
if it is explicitly set.

Line 162 (In 1.2.6) or line 233 (in 1.3b4) of Include is the following line
which as I understands it builds a absolute URL from a relative path from
the model:

        buildUrl.append(req.getContextPath()).append('/').append(url);

It's using the request's context path to build the absolute URL, if this is
behind a proxy it will fail, I changed my copy to this:

        buildUrl.append
(getApplication().getApplicationSettings().getContextPath()).append('/').append(url);

Am I misunderstanding this?

Jeremy

Re: possible bug in 1.2.6 / 1.3 Include

Posted by Al Maw <wi...@almaw.com>.
Jeremy Levy wrote:
> I found this while working on 1.2.6 and checked it out in 1.3 and it's the
> same. It appears as though Include does not pay attention to the contextpath
> if it is explicitly set.
> 
> Line 162 (In 1.2.6) or line 233 (in 1.3b4) of Include is the following line
> which as I understands it builds a absolute URL from a relative path from
> the model:
> 
>         buildUrl.append(req.getContextPath()).append('/').append(url);
> 
> It's using the request's context path to build the absolute URL, if this is
> behind a proxy it will fail, I changed my copy to this:
> 
>         buildUrl.append
> (getApplication().getApplicationSettings().getContextPath()).append('/').append(url);
> 
> Am I misunderstanding this?

Yeah, looks like a bug. Please open a JIRA issue and I'll look into it.

Regards,

Al

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


Re: possible bug in 1.2.6 / 1.3 Include

Posted by Eelco Hillenius <ee...@gmail.com>.
That looks like a good fix for 1.2. However, as far as I know, the
facility to manually set context paths was removed from 1.3. as that
always works with relative urls.

Eelco

On 10/16/07, Jeremy Levy <je...@meetmoi.com> wrote:
> I found this while working on 1.2.6 and checked it out in 1.3 and it's the
> same. It appears as though Include does not pay attention to the contextpath
> if it is explicitly set.
>
> Line 162 (In 1.2.6) or line 233 (in 1.3b4) of Include is the following line
> which as I understands it builds a absolute URL from a relative path from
> the model:
>
>         buildUrl.append(req.getContextPath()).append('/').append(url);
>
> It's using the request's context path to build the absolute URL, if this is
> behind a proxy it will fail, I changed my copy to this:
>
>         buildUrl.append
> (getApplication().getApplicationSettings().getContextPath()).append('/').append(url);
>
> Am I misunderstanding this?
>
> Jeremy
>

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