io exception - cannot close same stream twice
843834Nov 14 2003 — edited Nov 18 2003Hi.
Hoping someone can help with this problem. I have a JSP page which is receiving an XML request. Currently I pass the InputStream onto another class (whose source I do not have access to and cannot modify) and this parses the stream and creates a document (and I believe in doing so this closes the stream...is that correct?).
Problem is that now I have to change this JSP page because I need to determine the value of a tag within the XML request before I decide whether to call this class or not. I thought I'd create parse the stream into a document and then reference the node that way. I was able to do this and read the value of that node, but then when I called the class it threw the exception.
So basically I need another way to read the tag from the XML request without closing the stream down. I read some other posts that talked about creating a StringReader and using that, but wouldn't that close the input stream? I also read about using the mark() and reset() methods, but markSupported() returns "false" so I don't think I can use those.
Any ideas will be much appreciated.