You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Unmesh joshi <un...@hotmail.com> on 2010/04/18 17:17:57 UTC

UriMapper plugin

Hi,
I have been using struts for an year now and I always thought that expecting name and namespace of the action in URI is very limiting to application developers. It makes it very difficult to have actions mapping to UriTemplates like http://www.example.com/{foo}/{bar}/{baz}. Some times (as in my case), you might require a completely custom strategy of mapping uri to actions. To solve both these issues, I have written a simple plugin called. UriMapperPlugin. It is not well tested yet (frankly I do not even have unit tests.. thats a shame ..), but I wanted to verify if I am thinking on the correct lines.
I have a package provider registered. (com.opensymphony.xwork2.config.PackageProvider bean), that does following
1. Registers itself with Dispatcher for dispatcherInitialized event.2. In dispatcherInitialized, iterates through all the action configurations to get ActionMappingRule annotations ( see attached code). and keeps a map of action name and namespace  to  ActionMapper objects.3. It defines an ActionMapper which gets a reference to this package provider bean and iterates through all the rules to match http request. 
I have shared the code at http://code.google.com/p/urimapperplugin/
I will like to get comments and like to know if I am missing something obvious.
Thanks,Unmesh
 		 	   		  
_________________________________________________________________
South Cinema This Decade
http://entertainment.in.msn.com/southcinemathisdecade/

Re: UriMapper plugin

Posted by "chaki.sourabh@gmail.com" <ch...@gmail.com>.
Hi Unmesh,

I am not able to find the source code in
http://code.google.com/p/urimapperplugin/.Getting 404 Error.  Could you
please mail me the source code.

Thanks
Sourabh

--
View this message in context: http://struts.1045723.n5.nabble.com/UriTemplate-support-in-struts-tp3504352p4332419.html
Sent from the Struts - Dev mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org