you can write your own prepender if you want that works the way you want, or maybe juergen can come up with a better idea.
-Igor
On 6/19/06,
Ittay Dror <[EMAIL PROTECTED]> wrote:
if i understand correctly, this is how it goes:
i have a directory named 'web' with a tree of directories containing html and css files. the html files link to the css files by relative paths (../include/some.css)
the servlet is on the url pattern /pages/* the directory is mounted under pages/plugins/foo
this means, that if i have a page at pages/plugins/foo/somedir/page.html, and it references its css as the above, then the full path should be pages/plugins/foo/include/some.css. however, the prepender will take the application's context path (/pages), and prepend it to the relative url, thus getting /pages/../include/some.css, which doesn't point to the right place.
i think the prepender should use the mount path (ages/plugins/foo) for absolute urls and the page's path (pages/plugins/foo/somedir/) for relative urls
ittay
Igor Vaynberg wrote:
> let me just pipe in for a sec and explain why we do it that way. the
> problem with relative paths in wicket is that a page can be mounted at
> any point, so the relative's path point can vary - making relative paths
> useless somewhat. this is why we built the prepender - it turns all
> relative paths into absolute paths so that a page can be mounted on any
> mount /app/a or /app/a/b/c and all the hardcoded links to resources
> (js/css/img) still work.
>
> just giving some background
>
> -Igor
>
>
> On 6/19/06, *Ittay Dror* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
> Hi Juergen,
>
> the class that adds the '/' is
> wicket.markup.parser.filter.PrependContextPathHandler . it adds the
> application's context path to all href attributes.
>
> the thing is, it doesn't work with relative paths, as the one we're
> using. if my application is at /foo, and i have a page in
> /foo/bar/page.html, and it uses <link> with href="" then
> adding /foo/ will create an invalid link element.
>
> i think it should either check the path is not relative to the page,
> or, always use the page's path.
>
> ittay
>
>
>
> Juergen Donnerstag wrote:
> > And this is your base page? Would you please a junit test case.
> >
> > Juergen
> >
> > On 6/15/06, Ittay Dror < [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
> >> (i've sent this an hour ago, but can's see it on the list. so
> i'm resending, sorry if it appears twice)
> >>
> >>
> >> i'm using markup inheritance with head contribution:
> >> <wicket:head>
> >> <link href="" rel="stylesheet"
> type="text/css">
> >> ....
> >>
> >> the output is:
> >> <head>
> >> <link href="" type="text/css"
> rel="stylesheet">
> >>
> >> notice that the href now is absolute :-(
> >>
> >> thanks,
> >> ittay
> >>
> >> --
> >> ===================================
> >> Ittay Dror,
> >> Chief architect, openQRM TL,
> >> R&D, Qlusters Inc.
> >> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> >> +972-3-6081994 Fax: +972-3-6081841
> >>
> >> http://www.openQRM.org
> >> - Keeps your Data-Center Up and Running
> >>
> >>
> >>
> >> _______________________________________________
> >> Wicket-user mailing list
> >> [email protected]
> <mailto: [email protected]>
> >> https://lists.sourceforge.net/lists/listinfo/wicket-user
> >>
> >
> >
> > _______________________________________________
> > Wicket-user mailing list
> > [email protected]
> <mailto:[email protected]>
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> <https://lists.sourceforge.net/lists/listinfo/wicket-user>
> >
>
>
> --
> ===================================
> Ittay Dror,
> Chief architect, openQRM TL,
> R&D, Qlusters Inc.
> [EMAIL PROTECTED] <mailto: [EMAIL PROTECTED]>
> +972-3-6081994 Fax: +972-3-6081841
>
> http://www.openQRM.org
> - Keeps your Data-Center Up and Running
>
>
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> <mailto: [email protected]>
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
--
===================================
Ittay Dror,
Chief architect, openQRM TL,
R&D, Qlusters Inc.
[EMAIL PROTECTED]
+972-3-6081994 Fax: +972-3-6081841
http://www.openQRM.org
- Keeps your Data-Center Up and Running
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
_______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
