Answer the question
In order to leave comments, you need to log in
Did the PrintWriter work successfully?
Good day.
There is a servlet:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
PrintWriter out = response.getWriter();
out.println("<some html>");
out.close();
}
Answer the question
In order to leave comments, you need to log in
It is forbidden.
If the server sent an HttpServletResponse, then your code worked correctly and no exceptions will occur. Next, your some html goes over the network via the HTTP protocol (the server has already "fired back" and forgot about the request it just answered). The protocol specification does not imply sending messages to the server that data has been successfully received.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question