You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ChadDavis <ch...@gmail.com> on 2012/12/05 18:03:06 UTC

REST Mappers

What are the org.apache.struts2.dispatcher.mapper.RestufulActionMapper and
Restful2ActionMapper for?

Re: REST Mappers

Posted by ChadDavis <ch...@gmail.com>.
> So, I can't get this to work when using with convention/rest plugin
> > combination.  I did NOT try to use it with a xml/rest plugin combo.
>
> You can combine convention/xml/rest together - in struts.xml you can
> define constants or even a new stack which is simpler than use
> annotations
>

Yes.  The convention/xml/rest combo works for me.  It's just the
struts.rest.namespace part.  And I'll discuss that on another reply.

Re: REST Mappers

Posted by Lukasz Lenart <lu...@apache.org>.
2012/12/13 ChadDavis <ch...@gmail.com>:
> Perhaps I misunderstand the purpose of struts.rest.namespace.  I had
> thought it's purpose would be to cause the RestActionMapper to reject
> handling of all requests not in struts.rest.namespace.   Is this incorrect?

Hm... I think you're right, instead doing that on the factory level,
this handling can be done in mapper.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: REST Mappers

Posted by ChadDavis <ch...@gmail.com>.
> So, it seems like the RestActionMapper needs to be injected with the
> > struts.rest.namespace so it can be knowledgeable aobut this when building
> > the actionmapping namespace . . .
>
> But I thin it's rather how you name your action packages:
> - com.demo.action.rest.RestAction
> - com.demo.action.NormalAction
>

Perhaps I misunderstand the purpose of struts.rest.namespace.  I had
thought it's purpose would be to cause the RestActionMapper to reject
handling of all requests not in struts.rest.namespace.   Is this incorrect?

Re: REST Mappers

Posted by Lukasz Lenart <lu...@apache.org>.
2012/12/12 ChadDavis <ch...@gmail.com>:
>> support for namespace prefix - struts.rest.namespace
>
>
> So, I can't get this to work when using with convention/rest plugin
> combination.  I did NOT try to use it with a xml/rest plugin combo.

You can combine convention/xml/rest together - in struts.xml you can
define constants or even a new stack which is simpler than use
annotations

> After
> looking through the code, it doesn't appear that it would work, but I'm not
> that familiar with the code.  As Antonios says, the RestActionMapper
> doesn't see this setting at all.  The RestActionProxyFactory DOES see it
> though.  The problem is that by the time the proxy factory get's the
> ActionMapping, the mapper has already decided that the namespace is empty
> string.  So, the rest proxy thinks that the request isn't for a REST
> action, because it's not in struts.rest.namespace, and the whole request
> get's handed over to the default proxy factory.
>
> So, it seems like the RestActionMapper needs to be injected with the
> struts.rest.namespace so it can be knowledgeable aobut this when building
> the actionmapping namespace . . .

But I thin it's rather how you name your action packages:
- com.demo.action.rest.RestAction
- com.demo.action.NormalAction

I'll try to prepare a small demo


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: REST Mappers

Posted by ChadDavis <ch...@gmail.com>.
Did you try to use the new REST plugin without Convention plugin ?
> REST plugin can work with XML based configuration as well and it has
> support for namespace prefix - struts.rest.namespace


So, I can't get this to work when using with convention/rest plugin
combination.  I did NOT try to use it with a xml/rest plugin combo.  After
looking through the code, it doesn't appear that it would work, but I'm not
that familiar with the code.  As Antonios says, the RestActionMapper
doesn't see this setting at all.  The RestActionProxyFactory DOES see it
though.  The problem is that by the time the proxy factory get's the
ActionMapping, the mapper has already decided that the namespace is empty
string.  So, the rest proxy thinks that the request isn't for a REST
action, because it's not in struts.rest.namespace, and the whole request
get's handed over to the default proxy factory.

So, it seems like the RestActionMapper needs to be injected with the
struts.rest.namespace so it can be knowledgeable aobut this when building
the actionmapping namespace . . .

Re: REST Mappers

Posted by Antonios Gkogkakis <gk...@tcd.ie>.
On 10 December 2012 16:31, ChadDavis <ch...@gmail.com> wrote:

> On Sun, Dec 9, 2012 at 6:09 AM, Antonios Gkogkakis <gk...@tcd.ie>
> wrote:
>
> > another issue, was that every time we had a non REST action
> > being called. the RestActionMapper, would find it in the configuration
> and
> > would  treat it as a rest action with no method, so it would try to guess
> > the method and fail because the method didn't exist in the Action class.
> By
> >
>
>
> >I think I've figured this issue out too.  It requires configuring the
> >mappers to handle different URLs.
>

Keep as posted, I'll prepare the example for the Restful2ActionMapper in
case someone else is using that

Re: REST Mappers

Posted by ChadDavis <ch...@gmail.com>.
On Sun, Dec 9, 2012 at 6:09 AM, Antonios Gkogkakis <gk...@tcd.ie> wrote:

> another issue, was that every time we had a non REST action
> being called. the RestActionMapper, would find it in the configuration and
> would  treat it as a rest action with no method, so it would try to guess
> the method and fail because the method didn't exist in the Action class. By
>


I think I've figured this issue out too.  It requires configuring the
mappers to handle different URLs.

Re: REST Mappers

Posted by Lukasz Lenart <lu...@apache.org>.
2012/12/17 Antonios Gkogkakis <gk...@tcd.ie>:
> That's great Lukasz. Thanks!
> Just spotted a typo though, nampespaces :D

Done, thanks again!
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: REST Mappers

Posted by Antonios Gkogkakis <gk...@tcd.ie>.
That's great Lukasz. Thanks!
Just spotted a typo though, nampespaces :D

Regards,
Antonios

On 17 December 2012 14:53, Lukasz Lenart <lu...@apache.org> wrote:

> Done, thanks Antonios!
>
> https://cwiki.apache.org/confluence/display/WW/RestfulActionMapper
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> 2012/12/10 Antonios Gkogkakis <gk...@tcd.ie>:
> >> What would be the best way to share an example? Send it here on the
> list?
> >>You can register an issue and add text and example there or send it here
> >
> >
> > Since this is my first contribution I'll post it here :).  I based my
> > example on
> > https://cwiki.apache.org/confluence/display/WW/RestfulActionMapper so it
> > makes sense for someone viewing the wiki
> > Furthermore, I tested it struts 2.3.1.2 and I also have a similar working
> > example in production.
> >
> > To use the Restful2ActionMapper in an existing struts application we have
> > to change the strus.mapper.class constant
> > and let it point to the Restful2ActionMapper
> >  <constant
> > name="struts.mapper.class"
> > value="org.apache.struts2.dispatcher.mapper.Restful2ActionMapper"
> > />
> > The problem with the above approach is that we may break existing actions
> > because the Restful2ActionMapper tries to guess
> > the method name using conventions that aren't applicable to normal action
> > classes.
> >
> > To overcome the above problem, we have to use a different action mapper
> > depending on the url we want to process.
> > REST actions will be processed by the Restful2ActionMapper and non-REST
> > actions by the DefaultActionMapper
> >
> > To achieve that we have to rely on nampespaces and the
> > PrefixBasedActionMapper that can choose which action mapper to
> > use for a particular url based on a prefix (the action namespace).
> >
> > To put everything together, we create a package for our rest actions
> > <package name="rest" namespace="/rest" extends="struts-default">
> >     ....interceptor config
> >      <action name="movie/*" class="app.MovieAction">
> >     <param name="id">{0}</param>
> >         ....results
> >      </action>
> >     ....
> > </package>
> > All other actions remain in their existing packages and namespaces
> >
> > we use the PrefixBasedActionMapper telling it to use the
> > Restful2ActionMapper for actions
> > in the /rest namespace and the DefaultActionMapper for all other actions
> >
> > <constant
> > name="struts.mapper.class"
> > value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"
> > />
> > <constant name="struts.mapper.prefixMapping"
> value="/rest:restful2,:struts"
> > />
> >
> > For the Restful2ActionMapper to work we also have to set
> > <constant name="struts.enable.SlashesInActionNames" value="true" />
> > <constant name="struts.mapper.alwaysSelectFullNamespace" value="false" />
> >
> > @Chad
> > 1) I think you are looking at the issue of failing to guess the method
> > using Rest conventions for non-REST actions
> > but in the context of the ActionMapper used in the REST plugin
> > I don't know if something similar can be applied to the
> > RestFul2ActionMapper, I just documented how we used
> > the Restful2ActionMapper
> > 2) I've read your book, when I started working with struts2. Nice work
> > indeed !
> >
> > Regards,
> > Antonios
> >
> >
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>

Re: REST Mappers

Posted by Lukasz Lenart <lu...@apache.org>.
Done, thanks Antonios!

https://cwiki.apache.org/confluence/display/WW/RestfulActionMapper


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

2012/12/10 Antonios Gkogkakis <gk...@tcd.ie>:
>> What would be the best way to share an example? Send it here on the list?
>>You can register an issue and add text and example there or send it here
>
>
> Since this is my first contribution I'll post it here :).  I based my
> example on
> https://cwiki.apache.org/confluence/display/WW/RestfulActionMapper so it
> makes sense for someone viewing the wiki
> Furthermore, I tested it struts 2.3.1.2 and I also have a similar working
> example in production.
>
> To use the Restful2ActionMapper in an existing struts application we have
> to change the strus.mapper.class constant
> and let it point to the Restful2ActionMapper
>  <constant
> name="struts.mapper.class"
> value="org.apache.struts2.dispatcher.mapper.Restful2ActionMapper"
> />
> The problem with the above approach is that we may break existing actions
> because the Restful2ActionMapper tries to guess
> the method name using conventions that aren't applicable to normal action
> classes.
>
> To overcome the above problem, we have to use a different action mapper
> depending on the url we want to process.
> REST actions will be processed by the Restful2ActionMapper and non-REST
> actions by the DefaultActionMapper
>
> To achieve that we have to rely on nampespaces and the
> PrefixBasedActionMapper that can choose which action mapper to
> use for a particular url based on a prefix (the action namespace).
>
> To put everything together, we create a package for our rest actions
> <package name="rest" namespace="/rest" extends="struts-default">
>     ....interceptor config
>      <action name="movie/*" class="app.MovieAction">
>     <param name="id">{0}</param>
>         ....results
>      </action>
>     ....
> </package>
> All other actions remain in their existing packages and namespaces
>
> we use the PrefixBasedActionMapper telling it to use the
> Restful2ActionMapper for actions
> in the /rest namespace and the DefaultActionMapper for all other actions
>
> <constant
> name="struts.mapper.class"
> value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"
> />
> <constant name="struts.mapper.prefixMapping" value="/rest:restful2,:struts"
> />
>
> For the Restful2ActionMapper to work we also have to set
> <constant name="struts.enable.SlashesInActionNames" value="true" />
> <constant name="struts.mapper.alwaysSelectFullNamespace" value="false" />
>
> @Chad
> 1) I think you are looking at the issue of failing to guess the method
> using Rest conventions for non-REST actions
> but in the context of the ActionMapper used in the REST plugin
> I don't know if something similar can be applied to the
> RestFul2ActionMapper, I just documented how we used
> the Restful2ActionMapper
> 2) I've read your book, when I started working with struts2. Nice work
> indeed !
>
> Regards,
> Antonios
>
>
>>
>>

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


Re: REST Mappers

Posted by Antonios Gkogkakis <gk...@tcd.ie>.
> What would be the best way to share an example? Send it here on the list?
>You can register an issue and add text and example there or send it here


Since this is my first contribution I'll post it here :).  I based my
example on
https://cwiki.apache.org/confluence/display/WW/RestfulActionMapper so it
makes sense for someone viewing the wiki
Furthermore, I tested it struts 2.3.1.2 and I also have a similar working
example in production.

To use the Restful2ActionMapper in an existing struts application we have
to change the strus.mapper.class constant
and let it point to the Restful2ActionMapper
 <constant
name="struts.mapper.class"
value="org.apache.struts2.dispatcher.mapper.Restful2ActionMapper"
/>
The problem with the above approach is that we may break existing actions
because the Restful2ActionMapper tries to guess
the method name using conventions that aren't applicable to normal action
classes.

To overcome the above problem, we have to use a different action mapper
depending on the url we want to process.
REST actions will be processed by the Restful2ActionMapper and non-REST
actions by the DefaultActionMapper

To achieve that we have to rely on nampespaces and the
PrefixBasedActionMapper that can choose which action mapper to
use for a particular url based on a prefix (the action namespace).

To put everything together, we create a package for our rest actions
<package name="rest" namespace="/rest" extends="struts-default">
    ....interceptor config
     <action name="movie/*" class="app.MovieAction">
    <param name="id">{0}</param>
        ....results
     </action>
    ....
</package>
All other actions remain in their existing packages and namespaces

we use the PrefixBasedActionMapper telling it to use the
Restful2ActionMapper for actions
in the /rest namespace and the DefaultActionMapper for all other actions

<constant
name="struts.mapper.class"
value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper"
/>
<constant name="struts.mapper.prefixMapping" value="/rest:restful2,:struts"
/>

For the Restful2ActionMapper to work we also have to set
<constant name="struts.enable.SlashesInActionNames" value="true" />
<constant name="struts.mapper.alwaysSelectFullNamespace" value="false" />

@Chad
1) I think you are looking at the issue of failing to guess the method
using Rest conventions for non-REST actions
but in the context of the ActionMapper used in the REST plugin
I don't know if something similar can be applied to the
RestFul2ActionMapper, I just documented how we used
the Restful2ActionMapper
2) I've read your book, when I started working with struts2. Nice work
indeed !

Regards,
Antonios


>
>

Re: REST Mappers

Posted by Lukasz Lenart <lu...@apache.org>.
2012/12/10 Antonios Gkogkakis <gk...@tcd.ie>:
> No problem Lukasz.
> What would be the best way to share an example? Send it here on the list?

You can register an issue and add text and example there or send it here

> I created an account in the wiki, but I don't think I'm allowed to edit the
> page you send me

To have edit rights you must also fill ICLA and send it to secretary

http://www.apache.org/licenses/icla.txt


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: REST Mappers

Posted by Antonios Gkogkakis <gk...@tcd.ie>.
No problem Lukasz.
What would be the best way to share an example? Send it here on the list?
I created an account in the wiki, but I don't think I'm allowed to edit the
page you send me

Regards,
Antonios

On 9 December 2012 17:57, Lukasz Lenart <lu...@apache.org> wrote:

> 2012/12/9 Antonios Gkogkakis <gk...@tcd.ie>:
> > I've just had a quick look at the REST plugin in the trunk,  I'm assuming
> > that's the new version of the plugin you are referring to,
> > and I remembered that apart from the convention plugin issues we had,
> > another issue, was that every time we had a non REST action
> > being called. the RestActionMapper, would find it in the configuration
> and
> > would  treat it as a rest action with no method, so it would try to guess
> > the method and fail because the method didn't exist in the Action class.
> By
> > having a quick look at the code, I think we will still have that issue.
> > P.S I'm not seeing anything related to the struts.rest.namespace in the
> > ActionMapper.
>
> Ok, so they are useful though ;-)
>
> I found out that [1] and I think it needs some love :-) Antonios,
> could you share a bit of your project configuration to add it as an
> example ?
>
> [1] https://cwiki.apache.org/confluence/display/WW/RestfulActionMapper
>
>
> Thanks in advance & regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>

Re: REST Mappers

Posted by Lukasz Lenart <lu...@apache.org>.
2012/12/9 Antonios Gkogkakis <gk...@tcd.ie>:
> I've just had a quick look at the REST plugin in the trunk,  I'm assuming
> that's the new version of the plugin you are referring to,
> and I remembered that apart from the convention plugin issues we had,
> another issue, was that every time we had a non REST action
> being called. the RestActionMapper, would find it in the configuration and
> would  treat it as a rest action with no method, so it would try to guess
> the method and fail because the method didn't exist in the Action class. By
> having a quick look at the code, I think we will still have that issue.
> P.S I'm not seeing anything related to the struts.rest.namespace in the
> ActionMapper.

Ok, so they are useful though ;-)

I found out that [1] and I think it needs some love :-) Antonios,
could you share a bit of your project configuration to add it as an
example ?

[1] https://cwiki.apache.org/confluence/display/WW/RestfulActionMapper


Thanks in advance & regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: REST Mappers

Posted by Antonios Gkogkakis <gk...@tcd.ie>.
No Lukasz, I'm afraid I haven't

I've just had a quick look at the REST plugin in the trunk,  I'm assuming
that's the new version of the plugin you are referring to,
and I remembered that apart from the convention plugin issues we had,
another issue, was that every time we had a non REST action
being called. the RestActionMapper, would find it in the configuration and
would  treat it as a rest action with no method, so it would try to guess
the method and fail because the method didn't exist in the Action class. By
having a quick look at the code, I think we will still have that issue.
P.S I'm not seeing anything related to the struts.rest.namespace in the
ActionMapper.






On 9 December 2012 10:36, Lukasz Lenart <lu...@apache.org> wrote:

> 2012/12/9 Antonios Gkogkakis <gk...@tcd.ie>:
> > It is indeed an attempt to support RESTful urls.
> > When we wanted to add REST support to our existing struts2 app(using xml
> > config and not the convention plugin), we found that using the
> > Restful2ActionMapper with the PrefixBasedActionMapper which chooses
> > the appropriate ActionMapper based on a namespace, was the most
> > straightforward and less intrusive approach. Existing actions, were not
> > affected at all, and new actions where handled by the restful2 action
> > mapper, in their own namespace.
> > Had we wanted to use the more modern REST plugin, we would have to
> refactor
> > the app to use the convention plugin. I'm not sure whether
> > that's a straightforward task, but back then we encountered a few issues
> > and gave up.
> > So I think that for existing apps not using the convention plugin, which
> > wish to add REST support, the RestFull2ActionMapper
> > is still a viable solution
>
> Thanks Antonios!
>
> Did you try to use the new REST plugin without Convention plugin ?
> REST plugin can work with XML based configuration as well and it has
> support for namespace prefix - struts.rest.namespace
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>

Re: REST Mappers

Posted by Lukasz Lenart <lu...@apache.org>.
2012/12/9 Antonios Gkogkakis <gk...@tcd.ie>:
> It is indeed an attempt to support RESTful urls.
> When we wanted to add REST support to our existing struts2 app(using xml
> config and not the convention plugin), we found that using the
> Restful2ActionMapper with the PrefixBasedActionMapper which chooses
> the appropriate ActionMapper based on a namespace, was the most
> straightforward and less intrusive approach. Existing actions, were not
> affected at all, and new actions where handled by the restful2 action
> mapper, in their own namespace.
> Had we wanted to use the more modern REST plugin, we would have to refactor
> the app to use the convention plugin. I'm not sure whether
> that's a straightforward task, but back then we encountered a few issues
> and gave up.
> So I think that for existing apps not using the convention plugin, which
> wish to add REST support, the RestFull2ActionMapper
> is still a viable solution

Thanks Antonios!

Did you try to use the new REST plugin without Convention plugin ?
REST plugin can work with XML based configuration as well and it has
support for namespace prefix - struts.rest.namespace


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: REST Mappers

Posted by Lukasz Lenart <lu...@apache.org>.
2012/12/10 ChadDavis <ch...@gmail.com>:
> I'm planning to do that soon.  I'm keen to start making code contributions
> too.  I actually wrote a book about S2 in 2008, but then I didn't work with
> S2 professionally for several years. But I have recently rejoined the fold
> with a new job and am happy to be working with the framework again!

That one [1] ? I own it, very good book :-)

[1] http://www.manning.com/dbrown/


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: REST Mappers

Posted by ChadDavis <ch...@gmail.com>.
On Mon, Dec 10, 2012 at 9:30 AM, Lukasz Lenart <lu...@apache.org>wrote:

> > I'm adding the convention/rest plugin combo to our existing app right
> now.
> >  It's not well documented, but I think it's going to work out.  I'll
> write
> > up a blog entry and post it to the list when I'm finished with my spikes.
>
> You're more than welcome to fill ICLA and contribute to the docs :-)



I'm planning to do that soon.  I'm keen to start making code contributions
too.  I actually wrote a book about S2 in 2008, but then I didn't work with
S2 professionally for several years. But I have recently rejoined the fold
with a new job and am happy to be working with the framework again!

Re: REST Mappers

Posted by Lukasz Lenart <lu...@apache.org>.
2012/12/10 ChadDavis <ch...@gmail.com>:
> I'm adding the convention/rest plugin combo to our existing app right now.
>  It's not well documented, but I think it's going to work out.  I'll write
> up a blog entry and post it to the list when I'm finished with my spikes.

You're more than welcome to fill ICLA and contribute to the docs :-)


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: REST Mappers

Posted by ChadDavis <ch...@gmail.com>.
On Sun, Dec 9, 2012 at 3:24 AM, Antonios Gkogkakis <gk...@tcd.ie> wrote:

> Had we wanted to use the more modern REST plugin, we would have to refactor
> the app to use the convention plugin. I'm not sure whether
> that's a straightforward task, but back then we encountered a few issues
> and gave up.
>


I'm adding the convention/rest plugin combo to our existing app right now.
 It's not well documented, but I think it's going to work out.  I'll write
up a blog entry and post it to the list when I'm finished with my spikes.

Re: REST Mappers

Posted by Antonios Gkogkakis <gk...@tcd.ie>.
It is indeed an attempt to support RESTful urls.
When we wanted to add REST support to our existing struts2 app(using xml
config and not the convention plugin), we found that using the
Restful2ActionMapper with the PrefixBasedActionMapper which chooses
the appropriate ActionMapper based on a namespace, was the most
straightforward and less intrusive approach. Existing actions, were not
affected at all, and new actions where handled by the restful2 action
mapper, in their own namespace.
Had we wanted to use the more modern REST plugin, we would have to refactor
the app to use the convention plugin. I'm not sure whether
that's a straightforward task, but back then we encountered a few issues
and gave up.
So I think that for existing apps not using the convention plugin, which
wish to add REST support, the RestFull2ActionMapper
is still a viable solution
Antonios

On 8 December 2012 12:38, Lukasz Lenart <lu...@apache.org> wrote:

> 2012/12/5 ChadDavis <ch...@gmail.com>:
> > What are the org.apache.struts2.dispatcher.mapper.RestufulActionMapper
> and
> > Restful2ActionMapper for?
>
> It looks like a first attempt to add REST support to WebWork/Struts 2.
> I think they should be removed as current REST plugin is much better.
> I'll mark them @Deprecated if no one will complain
>
> https://issues.apache.org/jira/browse/WW-1475
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>

Re: REST Mappers

Posted by Lukasz Lenart <lu...@apache.org>.
2012/12/5 ChadDavis <ch...@gmail.com>:
> What are the org.apache.struts2.dispatcher.mapper.RestufulActionMapper and
> Restful2ActionMapper for?

It looks like a first attempt to add REST support to WebWork/Struts 2.
I think they should be removed as current REST plugin is much better.
I'll mark them @Deprecated if no one will complain

https://issues.apache.org/jira/browse/WW-1475


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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