Code example for PrintWriter

Methods: write

0
	public void doGet(HttpServletRequest request,
              HttpServletResponse response)
	throws ServletException, IOException { 
	response.setContentType("text/html");
		PrintWriter out = response.getWriter();
		out.write("<html><script>\nparent.");
		String body = request.getParameter("responseText");
		if (body == null) {
			HttpClient client = new HttpClient();
			HttpMethod method = new GetMethod(request.getParameter("responseUrl"));		
			client.executeMethod(method);
			body=method.getResponseBodyAsString();
		} 
		out.write(body);
		out.write("</script></html>");
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE