cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject RE: getting whole POSTed datas
Date Mon, 09 Apr 2001 17:30:12 GMT
Stéphane Arzt <sarzt@i-d.net> wrote:
>OK, thanks rob,
>I opened a book and it doesn't work anymore :)

Sorry, I should have answered earlier. This won't work because, as someone 
reported on the list a few days ago, cocoon already tries to read parameters 
from the request, which causes a call to getInputStream. And apparently 
getInputStream can't be called twice.

So this is a bug in Cocoon. I suggest you write a servlet instead, for now.

>there is my code :
>
>.....
>int clength = request.getContentLength();
>String ctype = request.getContentType();
>ServletInputStream s = request.getInputStream();
>byte[] b = new byte[clength];
>int i = s.readLine(b, 0, clength);
>if(i != -1) {
>   String st = new String(b, 0, clength);
>}
>......
>
>It return me :
>content-Type : application/x-www-form-urlencoded
>content-Length : 18 (the real length of the request I posted)
>content : (nothing) because i always return me -1.
>
>I can't see why if it knows content-length it can't return me the content 
>of
>the request.
>
>Please Help me !!
>
>Sorry Viktor for my silly questions but it not easy to start ;)
>
>Regards
>Stef
>
>
>
>
>Try request.getInputStream(); This will give you a servletinputstream from
>which you can read the raw data.
>
>
>   regards
>
>   Rob
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message