cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From St├ęphane Arzt <sa...@i-d.net>
Subject RE: getting whole POSTed datas
Date Mon, 09 Apr 2001 09:43:46 GMT
OK, thanks rob,
I opened a book and it doesn't work anymore :)
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

Mime
View raw message