public boolean execute(CommandRequest cmdReq) throws Exception { if (log.isDebugEnabled()) log.debug("ShowJSPAjaxResponse: " + jsp); cmdReq.getResponseObject().setHeader("Content-Encoding", HTTPSettings.lookup().getEncoding()); cmdReq .getResponseObject() .setContentType("text/html;charset=" + HTTPSettings.lookup().getEncoding()); if (region != null) { cmdReq.getRequestObject().setAttribute(Parameters.RENDER_IDREGION, region.getId()); } cmdReq .getRequestObject() .getRequestDispatcher(jsp) .include(cmdReq.getRequestObject(), cmdReq.getResponseObject()); return true; }
/** Returns the directory name for a session, creating it if it doesn't exist. */ public static String getTmpDir(javax.servlet.http.HttpServletRequest req) { String file = Application.lookup().getBaseAppDirectory() + "/" + HTTPSettings.lookup().getDownloadDir() + File.separator + req.getSession().getId(); File f = new File(file); if (!f.exists()) f.mkdirs(); return file; }
protected String getParameterMarkup(String name, Object value) { StringBuffer sb = new StringBuffer(); try { HTTPSettings webSettings = HTTPSettings.lookup(); sb.append(URLEncoder.encode(name, webSettings.getEncoding())) .append("=") .append(URLEncoder.encode(String.valueOf(value), webSettings.getEncoding())); } catch (UnsupportedEncodingException e) { log.error("Error: ", e); } return sb.toString(); }
protected String getEncoding() { HTTPSettings fr = HTTPSettings.lookup(); return fr.getEncoding(); }