• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reading XML from Servlet request

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying to read a XML Stream within a doPost request. Thats works fine and I can display the String value with request.getReader() but how can I access the stream with the request.getInputStream (or Source xmlSource ...)?
Or how can I build easily the inputStream to a DOM?

Thats my code so far:


I hope anyone could me some hints
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You would do that the same way you normally create a DOM from an InputStream. But isn't your question really why you get nothing when you try to do it in that code? The answer to that question is that the code you posted has already read the XML, and once it's read from the InputStream you can't read it again from the same InputStream.
reply
    Bookmark Topic Watch Topic
  • New Topic