You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Radoslav Krivak <rk...@gmail.com> on 2009/03/20 00:20:00 UTC

REST Plugin only for some actions

Hi,

could someone advise me how to configure REST plugin so that only some
actions will be "processed" by it. I do not want all actions to use REST url
scheme and url->method mapping.

Another issue that I have with REST plugin is that after adding it to my
application config-browser plugin stopped working. Has anyone encountered
the same problem?

Thanks

Rado

Re: REST Plugin only for some actions

Posted by RadoK <rk...@gmail.com>.
Hi Dale. 
Thank you for your answer. NamespaceBasedActionMapper sounds good, certainly
better than to have all actions mapped by REST plugin. But it isn't exactly
what I am looking for. I was hoping that one could have Rest controllers and
classic actions (mapped by convention plugin) living side by side in one
namespace. 
I guess that using NamespaceBasedActionMapper would involve compromises in
URL-map of web application and this could lead to confusing and inconsistent
urls.
Some actions in most webapps are CRUD-oriented and some are not. A was
thinking like that: there is this REST plugin, so why don't use it for CRUD
actions and get Restful WS API for free?   

So what I actually need is more fine grained ActionMapper that could decide
whether to use REST action mapping or somethiong else in one namespace. I'm
not afraid to write one but I would need someone with deeper insight in
struts2 to tell me that this is actually possible to do.   

Regards,
Rado  


DNewfield wrote:
> 
> Radoslav Krivak wrote:
>> could someone advise me how to configure REST plugin so that only some
>> actions will be "processed" by it. I do not want all actions to use REST
>> url
>> scheme and url->method mapping.
> 
> I built something I call NamespaceBasedActionMapper that allows you to 
> specify different action mappers for different namespaces.  If this is 
> what you're looking for, let me know.
> 
> http://www.nabble.com/REST-vs-Original-td14956768.html#a14972374
> 
> -Dale
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/REST-Plugin-only-for-some-actions-tp22611467p22618667.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: REST Plugin only for some actions

Posted by Dale Newfield <da...@newfield.org>.
Lotsopa wrote:
> Is there anything new about NamespaceBasedActionMapper :) I mean, does this
> thing work?

Someone convinced me a better name was "PrefixBasedActionMapper", but 
yes, it works fine.  The code can be found as an attachment to this JIRA 
issue:  https://issues.apache.org/struts/browse/WW-3260

-Dale

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


Re: REST Plugin only for some actions

Posted by Lotsopa <pr...@gmail.com>.
Is there anything new about NamespaceBasedActionMapper :) I mean, does this
thing work?


DNewfield wrote:
> 
> 
> I built something I call NamespaceBasedActionMapper that allows you to 
> specify different action mappers for different namespaces.  If this is 
> what you're looking for, let me know.
> 
> -Dale
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/REST-Plugin-only-for-some-actions-tp22611467p27158157.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re:Re: REST Plugin only for some actions

Posted by xnpeng <xn...@163.com>.
same situation with me,i want to set parameter for FileUpload action in REST:
<param>
    <allowedTypes>image/JPEG,image/PNG</allowedTypes>
</param>

how can I do this?



在2009-03-24,"Radoslav Krivak" <rk...@gmail.com> 写道:
>
>
>GF-7 wrote:
>> 
>> Is this a TODO or is it already available?
>> 
>
>In 2.1.6 it certainly isn't available. I was looking for something exactly
>like this, because it only makes sense. Maybe there is some work in progress
>for 2.1.7 (?).
>
>REST plugin is great idea, but sadly it seems to me that in current state it
>is more of a proof of concept than solution that you can use in real
>applications.
>
>Regards,
>Radoslav Krivak
>
>-- 
>View this message in context: http://www.nabble.com/REST-Plugin-only-for-some-actions-tp22611467p22676330.html
>Sent from the Struts - User mailing list archive at Nabble.com.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

Re:Re: REST Plugin only for some actions

Posted by xnpeng <xn...@163.com>.
agree!
 
I like rest, the great url patern. but,too many problems now.
I can browse http://localhost:8080/test/data.xml,but when call it in a jsp file dhtmlxtree.loadFrom("http://localhost:8080/test/data.xml"), it says there is no action or result named 'test'!
seems the server treat all .xml url as action,but why I can browse it directly?
may i tell struts2 don't treat .xml url as action?
 
 
 


 


在2009-03-30,"Dave Newton" <ne...@yahoo.com> 写道:
>Radoslav Krivak wrote:
>> REST plugin is great idea, but sadly it seems to me that in current state it
>> is more of a proof of concept than solution that you can use in real
>> applications.
>
>Drat, guess I'll have to do some undeploys.
>
>Dave
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>

Re: REST Plugin only for some actions

Posted by Dave Newton <ne...@yahoo.com>.
Radoslav Krivak wrote:
> REST plugin is great idea, but sadly it seems to me that in current state it
> is more of a proof of concept than solution that you can use in real
> applications.

Drat, guess I'll have to do some undeploys.

Dave


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


Re: REST Plugin only for some actions

Posted by Radoslav Krivak <rk...@gmail.com>.

GF-7 wrote:
> 
> Is this a TODO or is it already available?
> 

In 2.1.6 it certainly isn't available. I was looking for something exactly
like this, because it only makes sense. Maybe there is some work in progress
for 2.1.7 (?).

REST plugin is great idea, but sadly it seems to me that in current state it
is more of a proof of concept than solution that you can use in real
applications.

Regards,
Radoslav Krivak

-- 
View this message in context: http://www.nabble.com/REST-Plugin-only-for-some-actions-tp22611467p22676330.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: REST Plugin only for some actions

Posted by GF <ga...@gmail.com>.
Is this a TODO or is it already available?

On Tue, Mar 24, 2009 at 4:06 AM, dusty <du...@yahoo.com> wrote:
>
> Ultimately, we should declare what are "resources" and get the free mapping
> from the REST plugin for those Controllers.  Seems like that is what the
> NamspaceBasedActionMapper is, but I was thinking either a
>
> @Resource annotation at the top of the Controller
>
> or
>
> <constant name="struts.rest.resources" value="Person,Accountant,Gun,Escape"
> />
>
> -D
>
>
> DNewfield wrote:
>>
>> Dave Newton wrote:
>>> Dale Newfield wrote:
>>>> I built something I call NamespaceBasedActionMapper that allows you to
>>>> specify different action mappers for different namespaces.  If this is
>>>> what you're looking for, let me know.
>>>
>>> Oh, that's kinda interesting--is it on Google code? Plugin?
>>
>> I offered to contribute it a couple times, but nobody piped up...
>> ...if there's interest I can create a JIRA feature request and attach
>> the class to it.
>>
>> -Dale
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/REST-Plugin-only-for-some-actions-tp22611467p22673525.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: REST Plugin only for some actions

Posted by dusty <du...@yahoo.com>.
Ultimately, we should declare what are "resources" and get the free mapping
from the REST plugin for those Controllers.  Seems like that is what the
NamspaceBasedActionMapper is, but I was thinking either a

@Resource annotation at the top of the Controller

or 

<constant name="struts.rest.resources" value="Person,Accountant,Gun,Escape"
/>

-D


DNewfield wrote:
> 
> Dave Newton wrote:
>> Dale Newfield wrote:
>>> I built something I call NamespaceBasedActionMapper that allows you to 
>>> specify different action mappers for different namespaces.  If this is 
>>> what you're looking for, let me know.
>> 
>> Oh, that's kinda interesting--is it on Google code? Plugin?
> 
> I offered to contribute it a couple times, but nobody piped up...
> ...if there's interest I can create a JIRA feature request and attach 
> the class to it.
> 
> -Dale
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/REST-Plugin-only-for-some-actions-tp22611467p22673525.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: REST Plugin only for some actions

Posted by Dale Newfield <da...@newfield.org>.
Dave Newton wrote:
> Dale Newfield wrote:
>> I built something I call NamespaceBasedActionMapper that allows you to 
>> specify different action mappers for different namespaces.  If this is 
>> what you're looking for, let me know.
> 
> Oh, that's kinda interesting--is it on Google code? Plugin?

I offered to contribute it a couple times, but nobody piped up...
...if there's interest I can create a JIRA feature request and attach 
the class to it.

-Dale

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


Re: REST Plugin only for some actions

Posted by Dave Newton <ne...@yahoo.com>.
Dale Newfield wrote:
> Radoslav Krivak wrote:
>> could someone advise me how to configure REST plugin so that only some
>> actions will be "processed" by it. I do not want all actions to use 
>> REST url
>> scheme and url->method mapping.
> 
> I built something I call NamespaceBasedActionMapper that allows you to 
> specify different action mappers for different namespaces.  If this is 
> what you're looking for, let me know.

Oh, that's kinda interesting--is it on Google code? Plugin?

Dave


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


Re: REST Plugin only for some actions

Posted by Dale Newfield <da...@newfield.org>.
Radoslav Krivak wrote:
> could someone advise me how to configure REST plugin so that only some
> actions will be "processed" by it. I do not want all actions to use REST url
> scheme and url->method mapping.

I built something I call NamespaceBasedActionMapper that allows you to 
specify different action mappers for different namespaces.  If this is 
what you're looking for, let me know.

http://www.nabble.com/REST-vs-Original-td14956768.html#a14972374

-Dale

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