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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to