I agree that relative URLs are good.  But, I have multiple (20+) sites set
up running through a single Wicket application, and I am using Apache's
ProxyPass to front-end all of them under their respective domains.  I use an
absolute slash "/" because I actually want it to be absolute - not
relative.  I do this for all static resources because I have it configured
so that Apache does what it does best - serve static resources, and let
Tomcat handle only the dynamic stuff.  This allows for maximum scalability.

I think if someone uses an absolute slash - it should treat it as absolute.
That is what the standard is anywhere else within a web app, console
environment, you name it.  If you want relative to where you are, you leave
the slash off.  If you want absolute, you use the slash.  With the bug I
mention below, I have no way of forcing an absolute URL - Wicket takes that
away from me and makes it where I would have to inject the actual domain
into my application to be able to accomplish this.

Any other input?

Jeremy Thomerson

On 5/30/07, Al Maw <[EMAIL PROTECTED]> wrote:

Relative URLs are good - they make the page work properly behind proxy
servers. Why do you want an absolute one? Do your resources live in a
different context or something?

If you're trying to serve resources relative to your context root, just
add it with:
add(HeaderContributor.forCss("resources/styles/global.css"));

And that should work just fine (generating a relative URL).

Arguably we should strip off the first "/" if you put in an absolute
path, so this is more transparent to the end user. I'm not convinced
that enough people want to serve their resources from a different
context path that we should provide absolute URLs - they're obviously
open to people using them then wondering why it's broke behind a
mod_proxy.

Regards,

Al

--
Alastair Maw
Wicket-biased blog at http://herebebeasties.com


Jeremy Thomerson wrote:
> I consider this a bug, and was wondering if you do as well...  If so, I
> will open a JIRA and attach a patch for it.  Just let me know.
>
> In my 1.2.6 app, I have the following line:
> add(HeaderContributor.forCss("/resources/styles/global.css"));
>
> which generates this in the markup (correctly):
> <link rel ="stylesheet" type="text/css" href="/resources/css/global.css"
>  ></link>
>
>
> In 1.3, it generates this in the markup (incorrectly):
> <link rel ="stylesheet" type="text/css"
> href="../../..//resources/styles/global.css" ></link>
>
> This is because of the change to have everything with relative URLs, I
> am assuming.  But, I don't want a relative URL, I want an absolute one.
> I'm thinking that the following change would be appropriate:
>
> HeaderContributor.java (26)
> if (location.startsWith("http://";) || location.startsWith("https://";))
>
> changed to:
>
> if (location.startsWith("http://";) || location.startsWith("https://";) ||
> location.startsWith("/"))
>
>
> Thoughts?
> Jeremy Thomerson
> !DSPAM:465ca773246071804284693!

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to