Re: UrlResourceReference for images

2013-06-07 Thread bronius
Hi, I just tried it and it worked! Thanks guys for help, this situation really surprised me :) On the bright side at least I learned about framework when solving this little problem of mine as its easy to go inside and check how it works (im quite new to wicket). Best regards! -- View this mes

Re: UrlResourceReference for images

2013-06-07 Thread Bertrand Guay-Paquet
Try this: url.getSegments().add(""); url.getSegments().add("site2"); url.getSegments().add("image"); Have a look at the code of Url#isAbsolute(). It checks if the first segment is empty which is not the case with the code you provided in the first email. This behavior

Re: UrlResourceReference for images

2013-06-07 Thread harmoniaa
If you have src="app2/image?item-123" in a resource located in http://localhost:8080/app1/, it will be resolved as http://localhost:8080/app1/app2/image?item-123 as you noticed. Adding "/" to the beginning should help: src="/app2/image?item-123" should be resolved as http://localhost:8080/app2/ima

Re: UrlResourceReference for images

2013-06-07 Thread bronius
Yes that would be great, but src="app2/image?item-123" does not work (image is not loaded) and after changing it with firebug to src="http://localhost:8080/app2/image?item-123"; works fine. Any ideas why is that? Any stupid mistake i overlooked? Maybe wicket interprets relative url as http://localh

Re: UrlResourceReference for images

2013-06-07 Thread Bertrand Guay-Paquet
What you're saying is that a client requests the url http://localhost:8080/app1 and the img src attribute has app2/image?item-123 but you want it to be http://localhost:8080/app2/image?item-123 instead? Why does it make a difference? The relative url will be resolved to http://localhost:808

Re: UrlResourceReference for images

2013-06-07 Thread bronius
Relative is not good because resources are served from different application, just currently both applications are deployed on same tomcat so they have urls http://localhost:8080/app1 and http://localhost:8080/app2. When "smart" wicket renders image src i get something like this: so it thinks th

Re: UrlResourceReference for images

2013-06-06 Thread Bertrand Guay-Paquet
Hello, See inline. On 06/06/2013 5:27 PM, bronius wrote: First of all Url api is extremely hard to work with, very hard to create url i need, I think there should be some option to simply create it with simple string. Anyway Url.parse method does not create full url for me (i have localhost:808