Hello all,

I have (or had) a problem with mounted Resources and an iserted
jsessionid. My goal is, as discussed here before:
http://www.nabble.com/Bookmarkable-images-tf3706668.html#a10383150, to
have dynamic image URLs with just slashes and no
question-mark-separated querystring, like this:

/images/thumbnail/20.png

What I did was in short this:

Subclassed WebResource like this:

public IResourceStream getResourceStream() {
        String path = 
RequestCycle.get().getRequest().getRequestParameters().getPath();
        // ... parse path, return ResourceStream
        // path should be "images/thumbnail/20.png"
}

In my Application.init():

getSharedResources().add("imageDataResource", new ImageDataResource());
mountSharedResource(ImageDataResource.MOUNT_PATH, new
ResourceReference("imageDataResource").getSharedResourceKey());

Then a custom WebComponent, where I have an AttributeModifier for the
src attribute, where I compile the src like this:

ResourceReference resRef = new ResourceReference("imageDataResource");
String src = urlFor(resRef);
src += "thumbnail/20.png";  // this is dynamic in the application

This all works almost perfect.

It stops working when someone has disabled cookies, and jsessionid is
added to all URLs. Then they look a little strange like this:

/images;jsessionid=1ar97uck8ovr5/thumbnail/20.png

because urlFor(resRef) returns

/images;jsessionid=1ar97uck8ovr5

With such a URL, the command getRequestParameters().getPath() returns
simply "images", and all additional path info is lost.

Now, my first take at a solution would be to take the jsessionid into
consideration when building my URLs, so that they look like this:

/images/thumbnail/20.png;jsessionid=1ar97uck8ovr5

But maybe this is just a workaround for something I did wrong at another place?


-- 
greetings from Berlin,

Rüdiger Schulz

www.2rue.de

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to