i’m writing a servlet that receives a xml file, gives it to another class and gives a html file with some comments back to the client.
I’m getting the input-xml with something like:
input = request.getInputStream();
but this input is a ServletInputStream and the other class(for the comments) needs a FileInputStream.
If i give the XMLEventReader(in the other class) the ServletInputStream, i get a parsing error:
ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
And i think this is because of the servletinputstream instead of the fileinputstream.
Greetings
i hope somebody is able to help me:)
you should read the data from the ServletInputStream, and dump it into a FileOutputStream. this way you can look at the data that is being sent, then test that data separately using FileInputStream with the class you described that needs it. my guess is that the same thing will happen as is happening now since like the previous poster suggested, the data is probably in the wrong format.