I’m parsing a ServletRequest object(well, a HttpServletRequest really)
Have 2 parameters there, one of them I know to have a value which is an XML file.
How can I retrieve that XML as Doc or byte[] or similar, rather than String?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can convert
Stringtobyte[]easily enough using itsgetBytes()function.If you want a Doc, you’ll have to parse it. To do that, you can get a
DocumentBuilderfromDocumentBuilderFactoryand let thatparse()aByteArrayOutputStreamwrapped around that byte array.