On 3/19/08, Martin Makundi <[EMAIL PROTECTED]> wrote: > I have a somewhat similar situation without a solution (yet). > > I have some static resources (images and css files) on the server. > Whenever I deploy the application, the URL of those resources depend > on the environment as the application context root changes. What is > the best/only way to tackle this? > > <html> > <body> > static image: > <img src="/APPLICATION_CONTEXT/images/static_image.jpg"/> > </body> > </html> >
Have you tried wrapping your <img> tags with <wicket:link>? When you do this, you can get your browser to display the image properly using relative URLs. Beware, however, that the image URL must be relative to the current package of the page you're writing (at least until they apply my patch, hopefully). > > Is the only solution to make it a wicket element? This slows down > transferring a layout design into wicket significantly and seems like > an overkill. Back in the old days I would just have a tag replacement: > > <img src="<@APPLICATION_CONTEXT>/images/static_image.jpg"/> > > What is the wicket-way to do this without requiring a wicket id and a > hardcoded markup element for the Image in the Page java code. > > ** > Martin > > > 2008/3/19, Erik van Oosten <[EMAIL PROTECTED]>: > > > You were on the right track, label is the right choice. > > > > You need to provide Label a model that retrieves the string from your > > db. How you write that model is up to you. (I guess you already have > > this part.) > > > > If you do not want the encoding, call setEscapeModelStrings(false) on > > the label. > > > > Regards, > > Erik. > > > > > > > > mmocnik wrote: > > > Hi, > > > > > > I'm currently searching for a way to insert an HTML String which I get > out > > > of a DB into a Wicket Page. > > > The HTML string is from another application, so I can't change anything > in > > > it. > > > > > > My first approach was to use a Label, but as Labels encode HTML > entities, > > > this failed... > > > I just can't find any Component, that would fit here. > > > > > > Any sugestions on a component or alternate aproaches? > > > > > > Thanks and regards, > > > Marko > > > > > > > > > -- > > > > Erik van Oosten > > http://www.day-to-day-stuff.blogspot.com/ > > > > > > > > --------------------------------------------------------------------- > > 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] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]