Re: How to control IMG/CSS URL-Rewriting in mounted pages?
The markup filter that is responsible for this is: org.apache.wicket.markup.parser.filter.RelativePathPrefixHandler You can setup a custom MarkupParser that doesn't use this markup filter to solve your issue. On Fri, Aug 17, 2012 at 3:06 AM, Joachim Schrod wrote: > Thanks for these pointers! I'll check the classes out and see how I > can influence their behavior. > > Cheers, > Joachim > > > Bertrand Guay-Paquet wrote: >> Hi Joachim, >> >> I have never inspected them closely, but I think the classes in >> play are : >> WicketLinkTagHandler >> AutoLinkResolver >> >> As for the usefulness of this process, consider panels. Panels can >> be instantiated on any mount path so their links must be adjusted. >> >> Good luck! >> Bertrand >> >> On 15/08/2012 5:37 PM, Joachim Schrod wrote: >>> Well, one answer yet, with an assertion that Wicket does what I >>> don't want it to do. :-( >>> >>> So, is it really not possible to exchange bidirectionally HTML >>> files with an HTML designer who does *not* put all his HTML files >>> in web root? I thought being able to share files bidirectionally >>> with HTML designers was one of the major selling points of Wicket?! >>> >>> I assume nobody has the energy to really look at my issue. Would it >>> help if I put up a minimal example project for download that shows >>> my problem? Anybody willing to look then at it? >>> >>> I don't need a full solution. An hint like "class X does the URL >>> rewriting for images" would be most welcome, overwriting that >>> behavior with appropriate subclassing is something I can well do on >>> my own. >>> >>> Best, >>> Joachim >>> >>> >>> Joachim Schrod wrote: Hi, I'm new to Wicket and write my first application in it. I use "Wicket in Action" and online resources as documentation. (I stumbled already about the 1st few roadblocks owing to changes from Wicket 1.4 to 1.5. ;-)) So, if there's an easy pointer to answer my question, don't hesitate to just send it. My problem: I have a page that's mounted as URL "cat/entry". In the page's HTML there are links to images and CSS files that start with "..", e.g., "../images/bg_blabla.img". These are no Wicket components, just plain HTML. When Wicket renders the page, it rewrites the image URLs and prepends "../", e.g., the image URL now is output as "../../images/bg_blabla.img". I suppose it tries to adept to the extra path level that I introduced during mount and compensates for it. How can I stop Wicket from adding this "../" prefix? I searched via Google and read through Javadocs, but to no avail. For background: The URL in the HTML file is right... My HTML designers deliver their design files as "cat/entry.html", my mounts just follow their lead. I would like to change their files as little as possible, it makes files swapping back to/with them much easier. I hope somebody here may help me, thanks in advance. 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 > -- 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
Re: How to control IMG/CSS URL-Rewriting in mounted pages?
Thanks for these pointers! I'll check the classes out and see how I can influence their behavior. Cheers, Joachim Bertrand Guay-Paquet wrote: > Hi Joachim, > > I have never inspected them closely, but I think the classes in > play are : > WicketLinkTagHandler > AutoLinkResolver > > As for the usefulness of this process, consider panels. Panels can > be instantiated on any mount path so their links must be adjusted. > > Good luck! > Bertrand > > On 15/08/2012 5:37 PM, Joachim Schrod wrote: >> Well, one answer yet, with an assertion that Wicket does what I >> don't want it to do. :-( >> >> So, is it really not possible to exchange bidirectionally HTML >> files with an HTML designer who does *not* put all his HTML files >> in web root? I thought being able to share files bidirectionally >> with HTML designers was one of the major selling points of Wicket?! >> >> I assume nobody has the energy to really look at my issue. Would it >> help if I put up a minimal example project for download that shows >> my problem? Anybody willing to look then at it? >> >> I don't need a full solution. An hint like "class X does the URL >> rewriting for images" would be most welcome, overwriting that >> behavior with appropriate subclassing is something I can well do on >> my own. >> >> Best, >> Joachim >> >> >> Joachim Schrod wrote: >>> Hi, >>> >>> I'm new to Wicket and write my first application in it. I use >>> "Wicket in Action" and online resources as documentation. (I >>> stumbled already about the 1st few roadblocks owing to changes from >>> Wicket 1.4 to 1.5. ;-)) So, if there's an easy pointer to answer my >>> question, don't hesitate to just send it. >>> >>> My problem: I have a page that's mounted as URL "cat/entry". In the >>> page's HTML there are links to images and CSS files that start with >>> "..", e.g., "../images/bg_blabla.img". These are no Wicket >>> components, just plain HTML. >>> >>> When Wicket renders the page, it rewrites the image URLs and >>> prepends "../", e.g., the image URL now is output as >>> "../../images/bg_blabla.img". I suppose it tries to adept to the >>> extra path level that I introduced during mount and compensates >>> for it. >>> >>> How can I stop Wicket from adding this "../" prefix? I searched via >>> Google and read through Javadocs, but to no avail. >>> >>> For background: The URL in the HTML file is right... My HTML >>> designers deliver their design files as "cat/entry.html", my mounts >>> just follow their lead. I would like to change their files as >>> little as possible, it makes files swapping back to/with them much >>> easier. >>> >>> I hope somebody here may help me, thanks in advance. >>> >>> 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
Re: How to control IMG/CSS URL-Rewriting in mounted pages?
Hi Joachim, I have never inspected them closely, but I think the classes in play are : WicketLinkTagHandler AutoLinkResolver As for the usefulness of this process, consider panels. Panels can be instantiated on any mount path so their links must be adjusted. Good luck! Bertrand On 15/08/2012 5:37 PM, Joachim Schrod wrote: Well, one answer yet, with an assertion that Wicket does what I don't want it to do. :-( So, is it really not possible to exchange bidirectionally HTML files with an HTML designer who does *not* put all his HTML files in web root? I thought being able to share files bidirectionally with HTML designers was one of the major selling points of Wicket?! I assume nobody has the energy to really look at my issue. Would it help if I put up a minimal example project for download that shows my problem? Anybody willing to look then at it? I don't need a full solution. An hint like "class X does the URL rewriting for images" would be most welcome, overwriting that behavior with appropriate subclassing is something I can well do on my own. Best, Joachim Joachim Schrod wrote: Hi, I'm new to Wicket and write my first application in it. I use "Wicket in Action" and online resources as documentation. (I stumbled already about the 1st few roadblocks owing to changes from Wicket 1.4 to 1.5. ;-)) So, if there's an easy pointer to answer my question, don't hesitate to just send it. My problem: I have a page that's mounted as URL "cat/entry". In the page's HTML there are links to images and CSS files that start with "..", e.g., "../images/bg_blabla.img". These are no Wicket components, just plain HTML. When Wicket renders the page, it rewrites the image URLs and prepends "../", e.g., the image URL now is output as "../../images/bg_blabla.img". I suppose it tries to adept to the extra path level that I introduced during mount and compensates for it. How can I stop Wicket from adding this "../" prefix? I searched via Google and read through Javadocs, but to no avail. For background: The URL in the HTML file is right... My HTML designers deliver their design files as "cat/entry.html", my mounts just follow their lead. I would like to change their files as little as possible, it makes files swapping back to/with them much easier. I hope somebody here may help me, thanks in advance. Joachim Joachim - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to control IMG/CSS URL-Rewriting in mounted pages?
Well, one answer yet, with an assertion that Wicket does what I don't want it to do. :-( So, is it really not possible to exchange bidirectionally HTML files with an HTML designer who does *not* put all his HTML files in web root? I thought being able to share files bidirectionally with HTML designers was one of the major selling points of Wicket?! I assume nobody has the energy to really look at my issue. Would it help if I put up a minimal example project for download that shows my problem? Anybody willing to look then at it? I don't need a full solution. An hint like "class X does the URL rewriting for images" would be most welcome, overwriting that behavior with appropriate subclassing is something I can well do on my own. Best, Joachim Joachim Schrod wrote: > Hi, > > I'm new to Wicket and write my first application in it. I use > "Wicket in Action" and online resources as documentation. (I > stumbled already about the 1st few roadblocks owing to changes from > Wicket 1.4 to 1.5. ;-)) So, if there's an easy pointer to answer my > question, don't hesitate to just send it. > > My problem: I have a page that's mounted as URL "cat/entry". In the > page's HTML there are links to images and CSS files that start with > "..", e.g., "../images/bg_blabla.img". These are no Wicket > components, just plain HTML. > > When Wicket renders the page, it rewrites the image URLs and > prepends "../", e.g., the image URL now is output as > "../../images/bg_blabla.img". I suppose it tries to adept to the > extra path level that I introduced during mount and compensates for it. > > How can I stop Wicket from adding this "../" prefix? I searched via > Google and read through Javadocs, but to no avail. > > For background: The URL in the HTML file is right... My HTML > designers deliver their design files as "cat/entry.html", my mounts > just follow their lead. I would like to change their files as > little as possible, it makes files swapping back to/with them much > easier. > > I hope somebody here may help me, thanks in advance. > > Joachim > 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
RE: How to control IMG/CSS URL-Rewriting in mounted pages?
Wicket rewrite the SRC attribute of the image as relative to your webapp context unless you declare that image as a wicket component, give it a wicket:id and then use a ContextImage. Thus you would turn a to a . If you do so, then you can still preserve the "wrong" src relative path of "../images/image.jpg" so that your web developers can see the images while editing the static HTML resources and when you run the web-app Wicket will take care of fixing that URL for you no matter at what point you mount the page. If you have too many such images and refactoring might take you too long, then consider write your own Custom Wicket Tag Resolver for an attribute of the img HTML tag and override what the framework does for you (do call super) by changing the src attribute in a similar way ContextImage would do it for you. For example see this article: http://sanityresort.blogspot.com/2011/08/creating-custom-wicket-tag-resolver.html Or see how other such resolvers or AttributeModifer are used by Wicket itself, you can start with the AutoComponentResolver. ~ Good look to you! Paul Bors -Original Message- From: Joachim Schrod [mailto:jsch...@acm.org] Sent: Tuesday, August 14, 2012 2:53 AM To: users@wicket.apache.org Subject: Re: How to control IMG/CSS URL-Rewriting in mounted pages? Yes, that's what I observed and described below. And that behavior is not appropriate for my use case. So, how can I stop Wicket to "make the url relative to the web root no matter what mount path I use for the page"? I want to *change* that: my designer delivers HTML where the images are *not* relative to the web root, but to one directory below. In our HTML files are URLs like "../images/image.img" and I don't want to change these URLs. Alternatively, how can I tell Wicket that the web root has a different prefix just for rewriting these image URLs? Thanks, Joachim Martin Grigorov wrote: > Hi, > > If your images/css are in the web root then use something like > "images/image.img" in your .html. > Wicket will make the url relative to the web root no matter what mount > path you use for the page. > > On Mon, Aug 13, 2012 at 5:41 PM, Joachim Schrod wrote: >> Hi, >> >> I'm new to Wicket and write my first application in it. I use "Wicket >> in Action" and online resources as documentation. (I stumbled already >> about the 1st few roadblocks owing to changes from Wicket 1.4 to 1.5. >> ;-)) So, if there's an easy pointer to answer my question, don't >> hesitate to just send it. >> >> My problem: I have a page that's mounted as URL "cat/entry". In the >> page's HTML there are links to images and CSS files that start with >> "..", e.g., "../images/bg_blabla.img". These are no Wicket >> components, just plain HTML. >> >> When Wicket renders the page, it rewrites the image URLs and prepends >> "../", e.g., the image URL now is output as >> "../../images/bg_blabla.img". I suppose it tries to adept to the >> extra path level that I introduced during mount and compensates for it. >> >> How can I stop Wicket from adding this "../" prefix? I searched via >> Google and read through Javadocs, but to no avail. >> >> For background: The URL in the HTML file is right... My HTML >> designers deliver their design files as "cat/entry.html", my mounts >> just follow their lead. I would like to change their files as little >> as possible, it makes files swapping back to/with them much easier. >> >> I hope somebody here may help me, thanks in advance. >> >> 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to control IMG/CSS URL-Rewriting in mounted pages?
Yes, that's what I observed and described below. And that behavior is not appropriate for my use case. So, how can I stop Wicket to "make the url relative to the web root no matter what mount path I use for the page"? I want to *change* that: my designer delivers HTML where the images are *not* relative to the web root, but to one directory below. In our HTML files are URLs like "../images/image.img" and I don't want to change these URLs. Alternatively, how can I tell Wicket that the web root has a different prefix just for rewriting these image URLs? Thanks, Joachim Martin Grigorov wrote: > Hi, > > If your images/css are in the web root then use something like > "images/image.img" in your .html. > Wicket will make the url relative to the web root no matter what mount > path you use for the page. > > On Mon, Aug 13, 2012 at 5:41 PM, Joachim Schrod wrote: >> Hi, >> >> I'm new to Wicket and write my first application in it. I use >> "Wicket in Action" and online resources as documentation. (I >> stumbled already about the 1st few roadblocks owing to changes from >> Wicket 1.4 to 1.5. ;-)) So, if there's an easy pointer to answer my >> question, don't hesitate to just send it. >> >> My problem: I have a page that's mounted as URL "cat/entry". In the >> page's HTML there are links to images and CSS files that start with >> "..", e.g., "../images/bg_blabla.img". These are no Wicket >> components, just plain HTML. >> >> When Wicket renders the page, it rewrites the image URLs and >> prepends "../", e.g., the image URL now is output as >> "../../images/bg_blabla.img". I suppose it tries to adept to the >> extra path level that I introduced during mount and compensates for it. >> >> How can I stop Wicket from adding this "../" prefix? I searched via >> Google and read through Javadocs, but to no avail. >> >> For background: The URL in the HTML file is right... My HTML >> designers deliver their design files as "cat/entry.html", my mounts >> just follow their lead. I would like to change their files as >> little as possible, it makes files swapping back to/with them much >> easier. >> >> I hope somebody here may help me, thanks in advance. >> >> 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
Re: How to control IMG/CSS URL-Rewriting in mounted pages?
Hi, If your images/css are in the web root then use something like "images/image.img" in your .html. Wicket will make the url relative to the web root no matter what mount path you use for the page. On Mon, Aug 13, 2012 at 5:41 PM, Joachim Schrod wrote: > Hi, > > I'm new to Wicket and write my first application in it. I use > "Wicket in Action" and online resources as documentation. (I > stumbled already about the 1st few roadblocks owing to changes from > Wicket 1.4 to 1.5. ;-)) So, if there's an easy pointer to answer my > question, don't hesitate to just send it. > > My problem: I have a page that's mounted as URL "cat/entry". In the > page's HTML there are links to images and CSS files that start with > "..", e.g., "../images/bg_blabla.img". These are no Wicket > components, just plain HTML. > > When Wicket renders the page, it rewrites the image URLs and > prepends "../", e.g., the image URL now is output as > "../../images/bg_blabla.img". I suppose it tries to adept to the > extra path level that I introduced during mount and compensates for it. > > How can I stop Wicket from adding this "../" prefix? I searched via > Google and read through Javadocs, but to no avail. > > For background: The URL in the HTML file is right... My HTML > designers deliver their design files as "cat/entry.html", my mounts > just follow their lead. I would like to change their files as > little as possible, it makes files swapping back to/with them much > easier. > > I hope somebody here may help me, thanks in advance. > > 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 > -- 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