Code example for StringWriter

Methods: closeflushtoString

0
		try { 
			resp.setContentType("application/javascript");
			resp.setCharacterEncoding("utf-8");		
			if (desktopDefinitions == null)
			{ 
				StringWriter sw = new StringWriter();
				uio.emitDesktop(sw);
				sw.flush();
				sw.close();
				desktopDefinitions = sw.toString();
			} 
			resp.getWriter().write(desktopDefinitions);
		} catch (IOException e) {
			throw new UioException(e);
		}	 
	} 
 
	private void serveMobileDefinitions(HttpServletRequest req, HttpServletResponse resp) {
		try { 
			resp.setContentType("application/javascript");
Contextual code suggestions in your IDE  Get Codota for Java