Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Read XML file in a servlet

 
Muhammad Imad Qureshi
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I want to read xml file in a servlet as part of a HTTP post request. How do I do this. Am I going to use request.getInputStream() to read data or what. Is that possible to read the file as a file or may be separate elements.
Thanks
Imad
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be this will help
http://www.coderanch.com/t/361787/Servlets/java/HTTP-POST-body-gets-truncated

If it is part of body there is no need to create a file.
 
dema rogatkin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can pass this stream in InputSource of XML parser. It works like a charm.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic