struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeromy Evans <>
Subject Re: Some Idea On REST mapping
Date Tue, 02 Sep 2008 13:03:02 GMT
Ryan Wong wrote:
> I have changed the rest action mapper class to apply Ruby Style .
> there is draft, post here to find a better way to build RESTful app with
> struts2
I thought the RestActionMapper was already a copy of the RoR 
convention?  I think it already matches all your mappings except "new" 
is called "editNew". I'm no expert though.

> Besides, you could use Parameters and Parameter annotations with Regular
> Expression to support custom url pattern and Request Parameter Mapping.
> @Parameters( { @Parameter(pattern = "page/(\\w+)", property = "page") })
> public class TopicsController(){ }
> thus,
>   get http://localhost/namespace/controller/page/1
> will call controller's index() method with parameter {page=1} 

Sounds interesting. While it makes for a nice URL, some may argue 
against including params for a resource like this..
For params before the Controller (in the namespace) you may appreciate 
the NamedVariablePatternMatcher.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message