aspose file tools*
The moose likes Servlets and the fly likes How can we read the huge data using request object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How can we read the huge data using request object" Watch "How can we read the huge data using request object" New topic
Author

How can we read the huge data using request object

Saurabh Agarwal
Greenhorn

Joined: Aug 27, 2007
Posts: 22
Hi,

I am using Altova XML Spy to run the servlet, it calls the servlet and my servlet reads the data from request object using below code



request.getInputStream() does not work in my case as it reads the data to some limitation.

Can you please guide me which approach I should take to read the huge data from request object.

Thanks,
Neha
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42599
    
  65
request.getInputStream() does not work in my case as it reads the data to some limitation.

Please be more specific about this - how do you know it doesn't read all the data? How big is the file? Which servlet container are you using?


Ping & DNS - my free Android networking tools app
Saurabh Agarwal
Greenhorn

Joined: Aug 27, 2007
Posts: 22
I am using SAP Net Weaver Application Server.

My XML file contains more than 65536 charaters
If I run the file with this much charater it runs well but If I increase a single character it fails.
I am using DOM parser to parse the inputstream.



Please let me know If you need more details.



Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42599
    
  65
That's certainly not too much to handle for any servlet container. Could this be a limitation of the XML Spy program? Have you tried posting it using an HTML form in a browser?
Saurabh Agarwal
Greenhorn

Joined: Aug 27, 2007
Posts: 22
Yes I tried it from HTML also, it doesn't work

I have a strong feeling of problem with request.getInputStream();

I was searching on google and found to use MimeParser.

Can you please guide me.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42599
    
  65
I'm not sure what you mean by "MimeParser", but if that means that you intend to parse the input stream in your own code instead of relying on the built-in capabilities of the servlet container, then you're probably on the wrong track.

Have you verified (using a proxy like tcpmon) that the full data that you think is submitted is indeed being submitted? Have you examined the contents of the input stream to verify that the full contents do arrive at the server?
Saurabh Agarwal
Greenhorn

Joined: Aug 27, 2007
Posts: 22
No, the contents of the inputStream only contain upto 65536 characters and this what my problem is .

I found out that there is a limitation that HttpServletRequest object only can take maximum of 65536 characters and my data is longer than that.

so how do I feed in the complete data into the request object so that it can be read in the servlet.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42599
    
  65
I found out that there is a limitation that HttpServletRequest object only can take maximum of 65536 characters

This sound suspect. Did you determine that it's specifically a limitation of SAP Net Weaver Application Server? I'd be surprised by that, since it's a commercial product, and even free servlet containers have no problem handling much larger inputs than that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can we read the huge data using request object