I am having my first foray into Java servlet programming, and since I am more seasoned with "server side" programming, I have taken a few habits of dealing with Writers and OutputStreams. However, maybe these habits are not suitable when programming servlets, and the available Javadoc does not clearly answer the two questions I have below.
First question: should you catch IOExceptions thrown when you attempt to write to them? Provided that you don't, what is the default behaviour of servlet containers in this case (ie, what is the HTTP return code)?
Second question: should you let the servlet engine close the OUtputStream/Writer for you? Is there any danger in closing it yourself inside the servlet?