public static Boolean getBoolean(HttpServletRequest request, String name) { return RequestUtils.getBoolean(request, name); }
public static Float getFloat(HttpServletRequest request, String name) { return RequestUtils.getFloat(request, name); }
public static Integer getInteger(HttpServletRequest request, String name) { return RequestUtils.getInteger(request, name); }
public static Map getParams(HttpServletRequest request, String prefix) { return RequestUtils.getParams(request, prefix, null); }
public static Long getLong(HttpServletRequest request, String name) { return RequestUtils.getLong(request, name); }
/** * This implementation delegates to <code>ServletContext.getRealPath</code>, * but throws a FileNotFoundException if not found or not resolvable. * * @see javax.servlet.ServletContext#getRealPath(String) */ @Override public File getFile() throws IOException { String realPath = RequestUtils.getRealPath(this.servletContext, this.path); return new File(realPath); }
@Override public boolean verify(HttpServletRequest request, String response) { String remoteip = RequestUtils.getIpAddr(request); String challenge = request.getParameter("recaptcha_challenge_field"); if (Strings.isEmpty(response)) { return false; } String result = HttpUtils.getResponseText(apibase + "/verify?remoteip=" + remoteip + "&privatekey=" + privatekey + "&challenge=" + challenge + "&response=" + response); if (!result.contains("true")) { return false; } return true; }
@Override public Request convert(HttpServletRequest request) { String sp = RequestUtils.getServletPath((HttpServletRequest) request); int actionIdx = sp.indexOf(".action"); String suffix = ""; if (actionIdx > 0) { sp = sp.substring(0, actionIdx); suffix = ".action"; } else if (actionIdx < 0) { actionIdx = sp.indexOf(".do"); if (actionIdx > 0) { sp = sp.substring(0, actionIdx); suffix = ".do"; } } int alIdx = sp.indexOf("!"); if (alIdx > 0) { sp = sp.substring(0, alIdx); } return new DefaultRequest(sp + suffix, request.getMethod()); }
response.setContentType("application/vnd.ms-excel;charset=GBK"); response.setHeader("Content-Disposition", "attachment;filename=" + RequestUtils.encodeAttachName(request, context.getDatas().get("exportFile").toString()) + ".xls"); } else if (format.equals("txt")) { response.setContentType("application/vnd.text;charset=GBK"); response.setHeader("Content-Disposition", "attachment;filename=" + RequestUtils.encodeAttachName(request, context.getDatas().get("exportFile").toString()) + ".txt"); } else { throw new RuntimeException("Exporter is not supported for other format:" + exporter.getFormat());
public static Map getParams(HttpServletRequest request, String prefix, String exclusiveAttrNames) { return RequestUtils.getParams(request, prefix, exclusiveAttrNames); }
public static Object populate(HttpServletRequest request, Object obj, EntityType type, String name) { return Model.getPopulator().populate(obj, type, RequestUtils.getParams(request, name)); }
Map params = RequestUtils.getParams(request, prefix, exclusiveAttrNames); for (Iterator iter = params.keySet().iterator(); iter.hasNext();) { String attr = (String) iter.next();