About Question enthuware.jwpv6.2.1226 :
Posted: Sun Jul 14, 2013 1:50 am
if(name == null)
{
response.sendError(HttpServletResponse.SC_NOT_FOUND, "Unable to get name.");
}
out.println(name);
According to the API:
void sendError(int sc) throws java.io.IOException:
"After using this method, the response should be considered to be committed and should not be written to. ",
but "out.println(name);" still writes to the response, which is committed already. Shouldn't it cause an illegalStateException by writting to a committed response?
{
response.sendError(HttpServletResponse.SC_NOT_FOUND, "Unable to get name.");
}
out.println(name);
According to the API:
void sendError(int sc) throws java.io.IOException:
"After using this method, the response should be considered to be committed and should not be written to. ",
but "out.println(name);" still writes to the response, which is committed already. Shouldn't it cause an illegalStateException by writting to a committed response?