get big datas from client

Hi,

I have a client (javascript) that sends to my servlet big datas via parameter "document=....."

(document can be pdf, html ecc)

I use this line in my servlet:

String document = request.getParameter("document");

but "document" returns null.

How can I get correctly datas from client?

Thanks,

Julio

[354 byte] By [giulio_stevensa] at [2007-11-27 11:43:59]
# 1

Something like this:

String document = request.getQueryString("document")

MAnuel Leiria

manuel.leiriaa at 2007-7-29 17:53:04 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

I am not sure how you are sending big *documents* in a request URL. You can send only string parameters as part of url and you can get the same using request.getParameter(name).

Can you put the javascript code that used to invoke servlet?

ranjanbaisaka at 2007-7-29 17:53:04 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Rather use POST for binary data. Don't pass an unencoded byte array as GET parameter. That would hardly fail.

BalusCa at 2007-7-29 17:53:04 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

Balu, that would not give any NPE. The problem he is facing is NPE when he tries to getParameter from request string.

There is a limit of characters you can pass in a query string but that does not mean that it will give NPE.

It is better not suggest than wrong suggestion.

ranjanbaisaka at 2007-7-29 17:53:04 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

Where do you read that he is facing a NPE?

BalusCa at 2007-7-29 17:53:04 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

Sorry for typo, I mean Null by NPE. This is what I alway refer.

ranjanbaisaka at 2007-7-29 17:53:04 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...