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?
About Question enthuware.jwpv6.2.1226 :
Moderator: admin
-
- Posts: 13
- Joined: Thu Jul 11, 2013 11:22 pm
- Contact:
-
- Site Admin
- Posts: 10386
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.1226 :
No, as per Section 5.3, "If data is written to the response after these methods are called, the data is ignored."
Who is online
Users browsing this forum: No registered users and 6 guests