> Actually you just have to use "css/styles.css" and Wicket will > "relativize" it for you. > There is a special IMarkupFilter for that.
but only if wrap it inside <wicket:link> this will not work for resources in src/main/webapp but only for package resources without <wicket:link> the markup will just be rendered as-is and wicket will not even touch it. this is the standard behavior for static html with hrefs. Am 27.07.2011 um 15:40 schrieb Martin Grigorov: > On Wed, Jul 27, 2011 at 3:54 PM, Peter Ertl <pe...@gmx.org> wrote: >> if your login page is mounted to path '/login/authenticate' and the >> application is deployed to web application context '/myapp' your page will >> be available at >> >> /myapp/login/authenticate >> >> and the css in src/main/webapp/styles.css must be referenced from your page >> via >> >> 1) ../../css/styles.css >> >> or >> >> 2) /myapp/css/styles.css >> >> 1) is bad since the IDE is not capable of tracking the resources referenced >> from your markup. also changing your page mount can easily break your page. > Actually you just have to use "css/styles.css" and Wicket will > "relativize" it for you. > There is a special IMarkupFilter for that. >> 2) is bad since changing the deployment context name will break your app. >> also you need to know the deploment context name. >> >> when using resources in packages all these issues will not affect you at all. >> >> the 'magic' you talk about is probably not using <wicket:link>. In that case >> the link is unchanged (wicket does not even touch that link) and will work >> when you mount your pages to urls being not deeper than one level >> >> e.g. /login, /logout, /foobar >> >> it will not work with nested urls or url's that contain indexed parameters >> >> e.g. /user/id/123 >> >> Am 27.07.2011 um 14:31 schrieb Peter Karich: >> >>> Am 27.07.2011 14:21, schrieb Peter Ertl: >>>> You can put your resources in src/main/webapp but I would not recommend to >>>> do so (they will work by using an absolute path with the correct web app >>>> context) but it's quite ugly *imho* >>> >>> no, you can just reference them via css/style.css eg. if you have >>> src/main/webapp/css >>> and wicket will do the magic for you... >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > > > -- > Martin Grigorov > jWeekend > Training, Consulting, Development > http://jWeekend.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org