wicket always rewrites links to be context-relative. just because
something is mounted as /foo/page doesnt mean that is the only way to
access it. the behavior he is seeing is that his <img src="bar.gif"/>
is rewritten as <img src="../bar.gif"/> when the page is accessed
under its foo mount - which makes the url context-relative. this is
the correct behavior of wicket. if he wants that url to always be
/foo/bar.gif that is the url he should put into the markup.

-igor

On Tue, Nov 11, 2008 at 1:25 PM, Craig Tataryn <[EMAIL PROTECTED]> wrote:
>
> On 11-Nov-08, at 10:13 AM, Igor Vaynberg wrote:
>
>> wicket should be rewriting static urls for you so it should work
>> transparently. what usecase exactly does not work?
>>
>> -igor
>>
>
> Basically he has a setup like this: Apache2.2 -> Tomcat.
>
> He has Rewrite rules setup to make Apache serve the static content (and he
> confirmed they worked) and a ProxyPass rule to have requests to /hiswebapp
> served by Tomcat.
>
> So Apache handles all requests for:
> /hiswebapp/images/*
> /hiswebapp/styles/*
> /hiswebapp/js/*
> /hiswebapp/foo/images/*
> /hiswebapp/foo/styles/*
> /hiswebapp/foo/js/*
>
> And Tomcat handles the rest of the requests to /hiswebapp/*
>
> In his Wicket Application he'll do something like:
>
> mount(new QueryStringUrlCodingStrategy("foo/HomePage.html",HomePage.class));
>
> Now in the HomePage.html file that's linked to HomePage.class he expects
> that links to resources like <img src="images/myimage.jpg"/> should be
> requested from the browser as "/hiswebapp/foo/images/myimage.jpg" (because
> of the way he mounted the page under foo)  Likewise <img
> src="../images/anotherimage.jpg"/> should be requested as
> /hiswebapp/images/anotherimage.jpg.  This doesn't seem to be the case
> however.  When he tails the apache access_log he sees requests for
> /hiswebapp/images/myimage.jpg and /images/anotherimage.jpg respectively
> which give 404s.
>
> Not sure if that is enough info to go on, let me know if you need more.  If
> you say it should work the way he expects it to, then I tell him to
> re-examine things to see if perhaps he messed up his links or something.
>
> Craig.
>
>> On Mon, Nov 10, 2008 at 5:22 PM, Craig Tataryn <[EMAIL PROTECTED]>
>> wrote:
>>>
>>> If one were to mount a page like so:
>>>
>>> mount(new
>>> QueryStringUrlCodingStrategy("foo/HomePage.html",HomePage.class));
>>>
>>> How would you go about having it so resources referenced in HomePage.html
>>> are relative to foo/ and not /?  So if there was an <img
>>> src="images/myimage.jpg" /> inside HomePage.html, currently the server
>>> would
>>> get a request for <context for webapp>/images/myimage.jpg, whereas the
>>> goal
>>> is to have it requested as <context of webapp>/foo/images/myimage.jpg.
>>>
>>> Thought <base href="foo/"/> would do the trick, but it didn't seem to.
>>>
>>>
>>> Craig.
>>>
>>> --
>>> Craig Tataryn
>>> site: http://www.basementcoders.com/
>>> podcast:http://feeds.feedburner.com/TheBasementCoders
>>> irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
>>> im: [EMAIL PROTECTED], skype: craig.tataryn
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
> --
> Craig Tataryn
> site: http://www.basementcoders.com/
> podcast:http://feeds.feedburner.com/TheBasementCoders
> irc: ThaDon on freenode #basementcoders, ##wicket, #papernapkin
> im: [EMAIL PROTECTED], skype: craig.tataryn
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to