Thanks Don, that's the clarification I was looking for.
Eric
On Jan 5, 2007, at 2:47 PM, Don Brown wrote:
> On 1/5/07, Eric Rank <ericrank@(protected):
>> I'm interested in using the Restful2ActionMapper, but I'm unclear
>> about how to specify it's usage.
>>
>> 1. I'm assuming that I'll need to modify the "struts.mapper.class"
>> struts property. Is that right?
>
> Yep.
>
>> 2. In the struts-default.xml file that ships with Struts2, there's a
>> line, which names the class to "restful2":
>>
>> <bean type="
org.apache.struts2.dispatcher.mapper.ActionMapper"
>> name="restful2"
>> class="
org.apache.struts2.dispatcher.mapper.Restful2ActionMapper" />
>>
>> So, assuming that I need to modify the struts.mapper.class property,
>> which is right:
>>
>> struts.mapper.class=restful2
>>
>> or
>>
>> struts.mapper.class=org.apache.struts2.dispatcher.mapper.Restful2Acti
>> onM
>> apper
>
> Either is fine, but I'd recommend the first one. The second syntax is
> more useful when you have your own class you want to use.
>
>>
>>
>> 3. On a side note, I'm looking for a little clarification on the ReST
>> conventions in S2. The ReST conventions specify some fringe HTTP
>> methods (DELETE, PUT) for invoking the "remove" and "create" methods
>> of an action. To work around the limitations of HTML, the docs say to
>> use the parameter "__http_method" in order to make it work.
>> Practically speaking, does this mean that I need a form field to do
>> this?
>>
>> <s:hidden name="__http_method" value="'PUT'" />
>>
>> If I understand correctly, will this form field invoke the "create"
>> method of my action?
>
> Yes, that's my understanding. I really like this action mapper, but
> it does need some more thought as to exactly the best way to emulate
> ReST in web applications, and better integration from the tag
> libraries. The Ruby on Rails community has done some great work in
> this area I think we can learn from.
>
> Don
>>
>> Thanks!
>>
>> Eric Rank
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)