I am trying to implement an IRequestCodingStrategy that creates a "virtual"
directory in the url path for all generated links. An example url would be:

/contextName/folder-name1/mount/path/Home
/contextName/folder-name2/mount/path/Home

I would like both urls to go to Home.class which is mounted on /mouth/path.
I also would like other type of urls written in this structure (such as
listeners for links)

/contextName/folder-name1/listener/wicket-id-of-listener/[...]

I thought that I would be able to do this by extending
WebRequestCodingStrategy and providing my own implementation of
urlPrefix(RequestCycle) which obtained the virtual folder name from
somewhere in my application and appended it as part of the context name.
This way every url would have this appended and on decode I could extract it
as the first path after the context name. My plan was spoiled by
urlPrefix(..) being labeled final.

My next approach was to override WebRequestCodingStrategy.encode(...) to
call the super and return the super results with the folder appended to the
beginning. This looks like it has some promise assume 1) I don't use mounts
which would cause encode* not to be called and 2) I figure out some way to
handle decode (which is another final method that only provides a few places
to override a method, mostly around add*() ).

Is there something I am over looking? Is there a better way to do this?

Ryan
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to