/** * Override service, adding the setup for legacy. */ protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException { // parse the parameters of the request, considering Unicode issues, into a ParameterParser ParameterParser parser = new ParameterParser(req); // make this available from the req as an attribute req.setAttribute(ATTR_PARAMS, parser); // Setup.setup(req, resp); super.service(req, resp); }
/** * Override service, adding the setup for legacy. */ protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, java.io.IOException { // parse the parameters of the request, considering Unicode issues, into a ParameterParser ParameterParser parser = new ParameterParser(req); // make this available from the req as an attribute req.setAttribute(ATTR_PARAMS, parser); // Setup.setup(req, resp); super.service(req, resp); }
private String getFileName(String pContentDisposition) { String fileName = null; if (pContentDisposition != null) { String cdl = pContentDisposition.toLowerCase(); if (cdl.startsWith(FORM_DATA) || cdl.startsWith(ATTACHMENT)) { ParameterParser parser = new ParameterParser(); parser.setLowerCaseNames(true); // Parameter parser can handle null input Map params = parser.parse(pContentDisposition, ';'); if (params.containsKey("filename")) { fileName = (String) params.get("filename"); if (fileName != null) { fileName = fileName.trim(); } else { // Even if there is no value, the parameter is present, // so we return an empty file name rather than no file // name. fileName = ""; } } } } return fileName; }