Letractively / jcatapult

Automatically exported from code.google.com/p/jcatapult
0 stars 0 forks source link

JCatapult MVC clobbers HttpServletRequest's InputStream #77

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Not sure where it is happening, but at some point during the MVC processing
the ServletInputStream from the HttpServletRequest is getting emptied. This
means that it is impossible to get the body of the HTTP message out in an
application.

Original issue reported on code.google.com by bpontare...@gmail.com on 14 Aug 2008 at 11:49

GoogleCodeExporter commented 8 years ago
I actually noticed this issue too, but for some reason, at the time, I didn't 
equate
this to 'a problem', although it definitely is now that you mention it.

My application is retrieving an XML message from the HTTP Body and I was also 
unable
to use the injected HttpServletRequest.getInputStream() method to retrieve it.  
The
only way I could get around the issue was to send a HTTP Post and set the HTTP 
Body
to a binary representation of 'xml=<xml>'.  Then, in your action, you can 
create an
xml instance variable and the MVC will set that instance variable to the body.

Original comment by leafkn...@gmail.com on 14 Aug 2008 at 2:55

GoogleCodeExporter commented 8 years ago
Forgot to mention, it's my guess that this might be happening during the step 
when
the MVC retrieves the body to set instance variables in actions.

Original comment by leafkn...@gmail.com on 14 Aug 2008 at 2:57

GoogleCodeExporter commented 8 years ago
I think you are correct. My guess is that if you use the getParameter* methods, 
it
reads in the body. Any idea how to fix it?

Original comment by bpontare...@gmail.com on 14 Aug 2008 at 3:59

GoogleCodeExporter commented 8 years ago
no, but I can take a look.

Original comment by leafkn...@gmail.com on 14 Aug 2008 at 5:46

GoogleCodeExporter commented 8 years ago

Original comment by leafkn...@gmail.com on 10 Sep 2008 at 8:13

GoogleCodeExporter commented 8 years ago
In order to fix this we will need to update the MVC so that it doesn't touch any
parameters until it can safely determine that the action doesn't need the
InputStream. This will need to be done in the ActionMappingWorkflow, but this
workflow currently uses the parameters to determine if they user hit a button 
that
maps to a different action.

I think the best course is to check the original URI and see if it maps to an 
action.
If it does and that action has a @Body or some other type of annotation a flag 
is set
that tells the rest of the MVC to not touch the parameters.

Moving this to 1.1 as it isn't that important for 1.0.

Original comment by bpontare...@gmail.com on 15 Sep 2008 at 4:17

GoogleCodeExporter commented 8 years ago
This is now fixed in Trunk and will be in RC12. This is working on an internal 
Inversoft WebService.

Original comment by bpontare...@gmail.com on 13 Mar 2009 at 9:56