Description
I attached a patch for wicket-1.3.x and wicket.1.4.x to support indexed url encoding + query parameters for shared resources (somehow similar the way it is done with pages already). It contains javadoc and a WicketTestCase for regression tests.
the main class is
org.apache.wicket.request.target.coding.IndexedSharedResourceCodingStrategy
and can be used in WebApplication like this:
mount(new IndexedSharedResourceCodingStrategy(path, sharedResourceKey);
here an example:
for this url
/mountpath/foo/bar/123?name=joe&languages=java&languages=scala
the parameters value map will be
key value
---------------------------------------------
"0" "foo"
"1" "bar"
"2" "123"
"name" "joe"
"languages" String[]
accessing these is trivial:
public class TestResource extends Resource
{
@Override
public IResourceStream getResourceStream()
}
so you can have urls like these
/images/
{imagename}.
{format}/blog/2008/05/12/47-test-blog-entry.html
with absolutely no effort.
the greatest benefit is that shared resource urls look like static resources for the browser. this comes especially handy when utilizing browser caching. Also, the user will not realize the resources are served dynamically and bookmarking is easy. also, at least in my opinion, the urls are just "pretty"