Re: [S2] best practice for reading POST body in an action

2009-01-09 Thread Roger Varley
On Thursday 08 January 2009 18:12:48 John Cartwright wrote:
 No, in this case the mime type is not application/x-www-form-urlencoded
 and not sent w/ KVP from a form.  The body of the POST is all content.

Hmm, then I'm sorry I'm probably not going to be much help. Although I've done 
quite a bit of this sort of thing in the past, I always made sure that the 
body content was written as data=xmlblob/ by the client, and I don't 
think/remember that the mime type being sent by the client as being 
particularly significant. 

So ideas, assuming that you can't change your client to write the body as a 
key/value. Firstly I'd be surprised if Struts actually ignored/dropped your 
data so maybe the first thing to try is to post your data to an action and 
then look for any error/info messages that might give a hint as to what is 
going on if Struts can't map your request data to the RequestMap.

You could look at implementing the ServletAware interface  interceptor, but 
this ties your action too closely to the transport mechanism for my taste and 
makes testing a little more cumbersome.

If all else fails, I'd be tempted to create a custom interceptor that looks 
for these Posts and changes the body of the post to a key/value pair.

Sorry I can't be of more help.

Regards


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



Re: [S2] best practice for reading POST body in an action

2009-01-08 Thread John Cartwright
No, in this case the mime type is not application/x-www-form-urlencoded 
and not sent w/ KVP from a form.  The body of the POST is all content.


--john


Roger Varley wrote:

On Wednesday 07 January 2009 17:58:48 John Cartwright wrote:
  

Hello All,

Is there a best practice for using the body of a POST request w/in an
action?  The request is not key/value pairs but a blob of XML.  Before I
dropped back to using a traditional HTTPServletRequest approach, I'd see
if there was a better way in S2.


Forgive me if I'm being dense, but won't you still have a single key/value 
pair where key will be something and the value is your XML blob? 


Regards

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


  


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



[S2] best practice for reading POST body in an action

2009-01-07 Thread John Cartwright

Hello All,

Is there a best practice for using the body of a POST request w/in an 
action?  The request is not key/value pairs but a blob of XML.  Before I 
dropped back to using a traditional HTTPServletRequest approach, I'd see 
if there was a better way in S2.


Thanks!

--john


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



Re: [S2] best practice for reading POST body in an action

2009-01-07 Thread Roger Varley
On Wednesday 07 January 2009 17:58:48 John Cartwright wrote:
 Hello All,

 Is there a best practice for using the body of a POST request w/in an
 action?  The request is not key/value pairs but a blob of XML.  Before I
 dropped back to using a traditional HTTPServletRequest approach, I'd see
 if there was a better way in S2.

Forgive me if I'm being dense, but won't you still have a single key/value 
pair where key will be something and the value is your XML blob? 

Regards

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