CSS Links and request forwarding

View: New views
4 Messages — Rating Filter:   Alert me  

CSS Links and request forwarding

by Miguel Paraz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I have a servlet on /site. Depending on the User-Agent, it will use
the RequestDispatcher and forward to /site1 or /site2.
/site1 is mapped to the Wicket filter, /site2 is another plain servlet.

When I open site1 directly, the CSS link is alright.

In the original html:

<link href="site1/styles/site.css" rel="stylesheet" type="text/css" />

In the processed html:

<link href="../site1/styles/site.css" rel="stylesheet" type="text/css"/>


But, when I open this through /site and it passes through the
RequestDispatcher, the processed html becomes:

<link href="../../site1/styles/site.css" rel="stylesheet" type="text/css"/>


How did the base URL change?
Thanks.

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


Re: CSS Links and request forwarding

by jwcarman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Try redirecting rather than forwarding

On Tue, Jul 8, 2008 at 8:34 AM, Miguel Paraz <mparaz@...> wrote:

> Hi,
> I have a servlet on /site. Depending on the User-Agent, it will use
> the RequestDispatcher and forward to /site1 or /site2.
> /site1 is mapped to the Wicket filter, /site2 is another plain servlet.
>
> When I open site1 directly, the CSS link is alright.
>
> In the original html:
>
> <link href="site1/styles/site.css" rel="stylesheet" type="text/css" />
>
> In the processed html:
>
> <link href="../site1/styles/site.css" rel="stylesheet" type="text/css"/>
>
>
> But, when I open this through /site and it passes through the
> RequestDispatcher, the processed html becomes:
>
> <link href="../../site1/styles/site.css" rel="stylesheet" type="text/css"/>
>
>
> How did the base URL change?
> Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

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


Re: CSS Links and request forwarding

by Miguel Paraz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Jul 8, 2008 at 8:37 PM, James Carman <james@...> wrote:
> Try redirecting rather than forwarding

I'm trying to avoid redirecting.

Do you mean, forwarding cannot retain the correct URL?

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


Re: CSS Links and request forwarding

by jwcarman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The URL for the resources is based on the current URL used to access
the page.  Forwarding doesn't change the URL, so I assume that's
what's causing the problem.

On Tue, Jul 8, 2008 at 10:24 AM, Miguel Paraz <mparaz@...> wrote:

> On Tue, Jul 8, 2008 at 8:37 PM, James Carman <james@...> wrote:
>> Try redirecting rather than forwarding
>
> I'm trying to avoid redirecting.
>
> Do you mean, forwarding cannot retain the correct URL?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>

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