Re: S2 REST plugin URL mapping convention

2009-02-26 Thread ManiKanta G
Hmm... I found this two different behaviors in the S2 documentation itself. POST -> create , PUT -> update: http://struts.apache.org/2.x/docs/rest-plugin.html PUT -> create, POST -> update: http://cwiki.apache.org/S2PLUGINS/restful-crud-for-html-methods.html which one to choose? confused! Thanks

Re: [s2] rest plugin and rss output with Rome

2009-01-28 Thread Jeromy Evans
On 29/01/2009, at 2:48 PM, Dave Newton wrote: Bill Stilwell wrote: To me, this implies that there needs to be code to map whatever the particular model is to the needs of the RSS feed. Well yeah. I think maybe I'm just completely misunderstanding what your system looks like. The systems I

Re: [s2] rest plugin and rss output with Rome

2009-01-28 Thread Dave Newton
Bill Stilwell wrote: To me, this implies that there needs to be code to map whatever the particular model is to the needs of the RSS feed. Well yeah. I think maybe I'm just completely misunderstanding what your system looks like. The systems I've worked on tend to have a pretty orthogonal ty

Re: [s2] rest plugin and rss output with Rome

2009-01-28 Thread Bill Stilwell
On Wed, Jan 28, 2009 at 6:45 PM, Dave Newton wrote: > The action doesn't need to know; that's the point. The framework serializes > the action based on the content type handler (CTH) registered to the URL > extension. > > For example, the json extension uses a JSON serializer which will serialize

Re: [s2] rest plugin and rss output with Rome

2009-01-28 Thread Dave Newton
Bill Stilwell wrote: The bit I'm having trouble figuring out is how the action would > know that the model should be a SyndFeed object - is there a > standard way to detect what extension was used when calling the action? (I could parse it from request.getRequestURI(), but that seems a bit ugly

Re: [s2] rest plugin and rss output with Rome

2009-01-28 Thread Bill Stilwell
Yup, but as mentioned in the original email I'm not sure where to construct the SyndFeed object. Doing it in the content handler doesn't really make sense, as there's no generic way to map objects to an RSS/Atom feed. My basic idea is that the ContentTypeHandler would expect to be passed a SyndFeed

Re: [s2] rest plugin and rss output with Rome

2009-01-28 Thread Dave Newton
Bill Stilwell wrote: I'd like to solicit feedback on the best way to support .rss/.atom requests when using the rest plugin. Have you considered writing a custom content type handler? Content type handlers are chosen based on URL extension. Check the "Custom ContentTypeHandlers" section: ht

Re: [S2] REST Plugin + Validation

2008-09-02 Thread Dave Newton
--- On Tue, 9/2/08, alvins wrote: > However the problem is that when validation fails - I need > an input result which is specific for each method. As Jeremy said you'll probably have to do something with a custom workflow; probably the easiest solution. I had a similar problem eons ago with wild

Re: [S2] REST Plugin + Validation

2008-09-02 Thread Jeromy Evans
alvins wrote: Hmm I might just have to do that. I am guessing alot of people will run into this issue with the REST plugin - might be an idea to get some annotation into conventions or rest plugin (not sure where it would go) to allow for method specific result for validation failure? How do thes

Re: [S2] REST Plugin + Validation

2008-09-02 Thread alvins
Hmm I might just have to do that. I am guessing alot of people will run into this issue with the REST plugin - might be an idea to get some annotation into conventions or rest plugin (not sure where it would go) to allow for method specific result for validation failure? How do these things get pr

Re: [S2] REST Plugin + Validation

2008-09-02 Thread Jeromy Evans
alvins wrote: Thanks for the response Jeromy. I am actually already using that setting actually - I have two sets of different validations - one on the create method and one on the update method. However the problem is that when validation fails - I need an input result which is specific for eac

Re: [S2] REST Plugin + Validation

2008-09-02 Thread alvins
Thanks for the response Jeromy. I am actually already using that setting actually - I have two sets of different validations - one on the create method and one on the update method. However the problem is that when validation fails - I need an input result which is specific for each method. I hop

Re: [S2] REST Plugin + Validation

2008-09-01 Thread Jeromy Evans
alvins wrote: Hi guys, I have been wrestling with the REST plugin for the last couple of days and have posted some notes in another thread. I have hit a problem which I need a little help with. Basically in my REST controller I have a create and update method as per the REST guidelines. I need

Re: [S2} REST plugin & Security

2008-07-29 Thread Mike Watson
Thanks Jeromy, Yep, we did get the standard JEE security working in WAS. (Fat-fingered typing in the web.xml was the culprit). I'll have a look at the Sping option if we find the container stuff a bit lacking. Thanks again for your feedback. Mike 2008/7/29 Jeromy Evans <[EMAIL PROTECTED]>: > >

Re: [S2} REST plugin & Security

2008-07-28 Thread Jeromy Evans
If you don't have complex URL patterns, I'd continue down the JEE path. It should work. Although I haven't tried it with websphere it's a fundamental requirement of the container. I'd temporarily switch to HTTP BASIC instead of LDAP to try isolate the problem. Yes, creating a custom Secur

Re: [S2} REST plugin & Security

2008-07-27 Thread Mike Watson
I should probably add that I'm just trying to authenticate via LDAP at this stage. Authorization will be implemented later. 2008/7/28 Mike Watson <[EMAIL PROTECTED]>: > Hi Folks, > > What's the most straightforward way to secure my REST URLs? > > I'd assumed that I'd be able to use the standard JE

Re: S2 REST plugin

2008-07-24 Thread Mike Watson
Thanks mate. I'll give that a try tomorrow. 2008/7/24 Jeromy Evans <[EMAIL PROTECTED]>: > Mike Watson wrote: >> >> What I actually return is a DefaultHttpHeaders with a 404 set. >> getImage() returns an empty (not null) inputstream since there's no >> content for the body. >> >> > > You may need t

Re: S2 REST plugin

2008-07-24 Thread Jeromy Evans
Mike Watson wrote: What I actually return is a DefaultHttpHeaders with a 404 set. getImage() returns an empty (not null) inputstream since there's no content for the body. You may need to return a different result type for the error case (HttpHeaderResult or NullResult) so it only attempts

Re: S2 REST plugin

2008-07-24 Thread Mike Watson
What I actually return is a DefaultHttpHeaders with a 404 set. getImage() returns an empty (not null) inputstream since there's no content for the body. I'll do some debugging when I get time and see where it's failing. It certainly seems to be StreamResult that has the issue. Thanks Mike 2008/

Re: S2 REST plugin

2008-07-23 Thread Jeromy Evans
Mike Watson wrote: Hi folks, As mentioned in previous posts I'm using the REST plugin to serve images and everything seems to work fine when the content exists. However if I return an empty inputstream to StreamResult with a 404 response code I get the exception below. Stepping through the code