Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How can we read the huge data using request object

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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?
 
Saurabh Agarwal
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
    Bookmark Topic Watch Topic
  • New Topic