This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Read XML file in a servlet  RSS feed

 
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: 8933
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
Boost this thread!