Re: Referring to static files in .jar root directly from HTML, with context added automatically?

2013-01-19 Thread Joachim Schrod
Ondrej Zizka wrote:
> Hi all,
> 
> I'm wondering if I can refer to static files just from HTML, while
> keeping it aware of the context.
> 
> Example:
> 
> .jar contains /favicon.ico .
> I'd like to refer to it  by .
> But when the app is at non-root context, this breaks as it still
> points to http://host/favicon.ico .

Have you tried to use simply href="favicon.ico"?

AFAIK, Wicket adjusts that relativ URL accordingly when you mount
your pages to an application "sub-directory". (I fought it changing
such URLs some time ago.)

HTH,
Joachim

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Joachim Schrod, Roedermark, Germany
Email: jsch...@acm.org


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



Referring to static files in .jar root directly from HTML, with context added automatically?

2013-01-17 Thread Ondrej Zizka

Hi all,

I'm wondering if I can refer to static files just from HTML, while 
keeping it aware of the context.


Example:

.jar contains /favicon.ico .
I'd like to refer to it  by .
But when the app is at non-root context, this breaks as it still points 
to http://host/favicon.ico .


So it needs some Java code.

a) Either , which AFAIK can only make it bound to a component.
b) Or  custom ExternalLink with setContextRelative( true ) which would 
create the URL.

c) Or a shared resource mounted to /favicon.ico.

But the task seems to be so trivial that I wonder - Did I overlook some 
accordingly trivial solution, not involving Java?
And not relying on text replacement, e.g. by Maven, having rel="..." href="${context}/favicon.ico"> in HTML. (That would be 
acceptable if it was done by Wicket.)


Thanks,
Ondra

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