You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Dave Newton <ne...@yahoo.com> on 2008/11/08 18:35:12 UTC

2.1.3 REST plugin issue/sanity check

Running 2.1.3, playing with REST plugin again.

- o.a.s2.d.ng.filter.StrutsPrepareAndExecuteFilter.
- web.xml has actionPackages param, foo.bar
- struts.xml has some actions not in foo.bar pkg

I can only access non-foo.bar actions through show!execute.json URLs; I can't do show.action like I'd expect.

Why can I access the non-actionPackages actions via REST-like URLs at all?

Why don't I have access to non-actionPackages actions via normal S2 URLs?

If I disable classpath scanning for *both* REST and Codebehind plugins and leave the actionPackages param:

- I can't access RESTy actions at all
- I *can* access non-RESTy actions via REST syntax.

If I leave the actionPackages param blank and leave classpath scanning disabled for both plugins it's the same thing.

I'm a bit confused at the moment. On startup the non-actionPackages actions are being picked up from the struts.xml, but I can't access them. I kinda need both, though.

I'm assuming I'm missing something obvious, but so far I'm not sure what it is.

Thanks,
Dave


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


Re: 2.1.3 REST plugin issue/sanity check

Posted by Dave Newton <ne...@yahoo.com>.
--- On Sun, 11/9/08, Jeromy Evans wrote:
> No, you can't use both approaches in the same app.

Yeah, the more I dug into it the more I realized that.

I'm not sure I like that so much.

> That's not a complete solution though.  The rest plugin
> overrides the ActionProxyFactory with one that creates
> RestActionInvocations.  You can have DefaultActionInvocations 
> and RestActionInvocations in the same application unless you 
> create a composite ActionProxyFactory.

Grr. Thanks for the info; I guess it's a little worse than I thought.

Dave


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


Re: 2.1.3 REST plugin issue/sanity check

Posted by Jeromy Evans <je...@blueskyminds.com.au>.

Dave Newton wrote:
> Removing the REST plugin restores regular S2 .action accessibility. So I guess my questions are: is this by design, and is there a way to combine both in the same app?
>
>   

 No, you can't use both approaches in the same app.

You can get most of the way by setting up the a composite action 
mapper.  Not THE CompositionActionMapper, but rather one that splits the 
handling based on the URI.
eg. if it ends in .action, send to default action mapper, otherwise send 
to RESTful action mapper.

That's not a complete solution though.  The rest plugin overrides the 
ActionProxyFactory with one that creates RestActionInvocations.  You can 
have DefaultActionInvocations and RestActionInvocations in the same 
application unless you create a composite ActionProxyFactory.

It's all in or not at all I'm afraid.



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


Re: 2.1.3 REST plugin issue/sanity check

Posted by Dave Newton <ne...@yahoo.com>.
Removing the REST plugin restores regular S2 .action accessibility. So I guess my questions are: is this by design, and is there a way to combine both in the same app?

Dave

--- On Sat, 11/8/08, Dave Newton wrote:
> Running 2.1.3, playing with REST plugin again.
> 
> - o.a.s2.d.ng.filter.StrutsPrepareAndExecuteFilter.
> - web.xml has actionPackages param, foo.bar
> - struts.xml has some actions not in foo.bar pkg
> 
> I can only access non-foo.bar actions through
> show!execute.json URLs; I can't do show.action like
> I'd expect.
> 
> Why can I access the non-actionPackages actions via
> REST-like URLs at all?
> 
> Why don't I have access to non-actionPackages actions
> via normal S2 URLs?
> 
> If I disable classpath scanning for *both* REST and
> Codebehind plugins and leave the actionPackages param:
> 
> - I can't access RESTy actions at all
> - I *can* access non-RESTy actions via REST syntax.
> 
> If I leave the actionPackages param blank and leave
> classpath scanning disabled for both plugins it's the
> same thing.
> 
> I'm a bit confused at the moment. On startup the
> non-actionPackages actions are being picked up from the
> struts.xml, but I can't access them. I kinda need both,
> though.
> 
> I'm assuming I'm missing something obvious, but so
> far I'm not sure what it is.

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