public static void createResponse(HttpServletRequest request,HttpServletResponse response,HttpServlet servlet,Properties cookieProperties,WebDoc doc,boolean debug) throws IOException {
  response.setHeader("Cache-Control","no-cache");
  response.setContentType("text/html; charset=UTF-8");
  if (cookieProperties != null) {
    Cookie cookie=new Cookie(WebEnv.COOKIE_INFO,propertiesEncode(cookieProperties));
    cookie.setComment("(c) adempiere, Inc - Jorg Janke");
    cookie.setSecure(false);
    cookie.setPath("/");
    if (cookieProperties.size() == 0)     cookie.setMaxAge(0);
 else     cookie.setMaxAge(2592000);
    response.addCookie(cookie);
  }
  if (debug && WebEnv.DEBUG) {
    WebEnv.addFooter(request,response,servlet,doc.getBody());
  }
  PrintWriter out=response.getWriter();
  doc.output(out);
  out.flush();
  if (out.checkError())   log.log(Level.SEVERE,"error writing");
  out.close();
}

public static void createResponse ( HttpServletRequest request , HttpServletResponse response , HttpServlet servlet , Properties cookieProperties , WebDoc doc , boolean debug ) throws IOException { response . setHeader ( "Cache-Control" , "no-cache" ) ; response . setContentType ( "text/html; charset=UTF-8" ) ; if ( cookieProperties != null ) { Cookie cookie = new Cookie ( WebEnv . COOKIE_INFO , propertiesEncode ( cookieProperties ) ) ; cookie . setComment ( "(c) adempiere, Inc - Jorg Janke" ) ; cookie . setSecure ( false ) ; cookie . setPath ( "/" ) ; if ( cookieProperties . size ( ) == 0 ) cookie . setMaxAge ( 0 ) ; else cookie . setMaxAge ( 2592000 ) ; response . addCookie ( cookie ) ; } if ( debug && WebEnv . DEBUG ) { WebEnv . addFooter ( request , response , servlet , doc . getBody ( ) ) ; } PrintWriter out = response . getWriter ( ) ; doc . output ( out ) ; out . flush ( ) ; if ( out . checkError ( ) ) log . log ( Level . SEVERE , "error writing" ) ; out . close ( ) ; }
create standard response header with optional cookie and print document . d : \ j2sdk1 . 4 . 0 \ docs \ guide \ intl \ encoding . doc . html
