List of usage examples for javax.servlet.http HttpServletRequest getParameterMap
public Map<String, String[]> getParameterMap();
From source file:net.shopxx.plugin.tenpayBankPayment.TenpayBankPaymentPlugin.java
@Override public boolean verifyNotify(PaymentPlugin.NotifyMethod notifyMethod, HttpServletRequest request) { PluginConfig pluginConfig = getPluginConfig(); PaymentLog paymentLog = getPaymentLog(request.getParameter("out_trade_no")); if (paymentLog != null && generateSign(request.getParameterMap()).equals(request.getParameter("sign")) && pluginConfig.getAttribute("partner").equals(request.getParameter("partner")) && "0".equals(request.getParameter("trade_state")) && paymentLog.getAmount().multiply(new BigDecimal(100)) .compareTo(new BigDecimal(request.getParameter("total_fee"))) == 0) { try {//from w w w . j a v a 2 s . c om Map<String, Object> parameterMap = new HashMap<String, Object>(); parameterMap.put("input_charset", "utf-8"); parameterMap.put("sign_type", "MD5"); parameterMap.put("partner", pluginConfig.getAttribute("partner")); parameterMap.put("notify_id", request.getParameter("notify_id")); String verifyUrl = "https://gw.tenpay.com/gateway/simpleverifynotifyid.xml?input_charset=utf-8&sign_type=MD5&partner=" + pluginConfig.getAttribute("partner") + "¬ify_id=" + request.getParameter("notify_id") + "&sign=" + generateSign(parameterMap); Document document = new SAXReader().read(new URL(verifyUrl)); Node node = document.selectSingleNode("/root/retcode"); if ("0".equals(node.getText().trim())) { return true; } } catch (DocumentException e) { throw new RuntimeException(e.getMessage(), e); } catch (MalformedURLException e) { throw new RuntimeException(e.getMessage(), e); } } return false; }
From source file:cat.calidos.morfeu.webapp.GenericHttpServlet.java
@Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String path = req.getPathInfo(); log.trace("GenericMorfeuServlet::doGet {}", path); Map<String, String> params = normaliseParams(req.getParameterMap()); params.put(METHOD, req.getMethod()); params = processParams(params);// ww w . j av a 2 s. c o m ControlComponent controlComponent = getControl(path, params); handleResponse(resp, controlComponent); }
From source file:cat.calidos.morfeu.webapp.GenericHttpServlet.java
@Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String path = req.getPathInfo(); log.trace("GenericMorfeuServlet::doPost {}", path); Map<String, String> params = normaliseParams(req.getParameterMap()); params.put(METHOD, req.getMethod()); String content = IOUtils.toString(req.getInputStream(), Config.DEFAULT_CHARSET); params.put(POST_VALUE, content);//w w w . j a v a 2 s . co m params = processParams(params); ControlComponent controlComponent = putControl(path, params); handleResponse(resp, controlComponent); }
From source file:com.jaspersoft.jasperserver.rest.services.RESTRole.java
@Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServiceException { WSRoleSearchCriteria criteria = restUtils.populateServiceObject(req.getPathInfo(), req.getParameterMap(), WSRoleSearchCriteria.class); WSRole[] roles = null;// w w w. j av a 2s . c o m try { // get the resources.... roles = userAndRoleManagementService.findRoles(criteria); } catch (AxisFault axisFault) { throw new ServiceException(HttpServletResponse.SC_NOT_FOUND, "could not locate roles in uri: " + criteria.getRoleName() + axisFault.getLocalizedMessage()); } if (log.isDebugEnabled()) { log.debug(roles.length + " roles were found"); } String marshal = generateSummeryReport(roles); if (log.isDebugEnabled()) { log.debug("Marshaling OK"); } restUtils.setStatusAndBody(HttpServletResponse.SC_OK, resp, marshal); }
From source file:com.ms.app.web.commons.valve.BaseWebUserBuilderValve.java
protected PipelineResult getToLogin(HttpServletRequest request) { String url = loginUrl;/* w ww. j a va 2 s . co m*/ String uri = request.getRequestURI(); // ????returnurl if (request.getParameterMap().isEmpty() && !StringUtils.contains("/login", uri)) { url = loginUrl + "?returnurl=" + uri; } return PipelineResult.gotoFinally("gotoLogin", url); }
From source file:eu.comvantage.dataintegration.SparulSimulationServlet.java
/** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) *///from w ww . j a v a 2s. c o m protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub String eventID = ""; if (request.getParameterMap().containsKey("eventID")) eventID = request.getParameter("eventID"); response.setContentType("text/html"); PrintWriter out = response.getWriter(); String uri = request.getRequestURI(); ServletContext context = getServletContext(); String serverName = ""; if (request.getLocalName().startsWith("0")) { serverName = "localhost"; } else { serverName = request.getLocalName(); } simulateEvent(eventID, new String("http://" + serverName + ":" + request.getLocalPort() + request.getContextPath() + "/QueryDistributionServiceImpl/SPARUL")); out.write("'" + eventID + "' simulated. "); }
From source file:com.dreambox.web.logger.LoggingFilter.java
private String getRequestParams(HttpServletRequest request) { String parameter = ""; if (request instanceof HttpServletRequest && !isMultipart(request)) { Map<String, String[]> parameters = request.getParameterMap(); for (Map.Entry<String, String[]> entry : parameters.entrySet()) { String[] values = entry.getValue(); String key = entry.getKey(); String keyValues = ""; if (values == null || values.length == 0) { continue; } else { if (values.length == 1) { keyValues = values[0]; } else { keyValues = Arrays.toString(values); }//from w ww . j a v a 2 s .c o m } parameter += "{" + key + ":" + keyValues + "}"; } } return parameter; }
From source file:org.opentestsystem.authoring.testauth.rest.FileGroupController.java
@RequestMapping(value = "/fileGroup/searchByPsychometricVersion", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Secured({ "ROLE_Result Upload Read" }) @ResponseBody//from w ww .j a va 2 s . c om public SearchResponse<FileGroup> searchPsychometricRecordFileGroupsByVersion(final HttpServletRequest request, final HttpServletResponse response) { return this.fileGroupService.searchPsychometricRecordFileGroupsByVersion(request.getParameterMap()); }
From source file:org.opentestsystem.authoring.testspecbank.rest.TestSpecificationController.java
@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @Secured({ "ROLE_Test Spec Read" }) @ResponseBody/* w w w . ja v a 2 s. co m*/ public SearchResponse<TestSpecification> searchTestSpecification( @RequestParam(value = "includeXml", required = false) final boolean includeXml, final HttpServletRequest request, final HttpServletResponse response) { SearchResponse<TestSpecification> searchResponse = this.testSpecificationService .searchTestSpecifications(request.getParameterMap(), includeXml); tenantEnforcementService.verifyUserIsConfiguredToReadObjects(searchResponse, "ROLE_Test Spec Read"); return searchResponse; }
From source file:com.pzy.jcook.project.web.FrontController.java
@RequestMapping("submitExam/{id}") public String submitExam(HttpServletRequest req, Long id, Model model) { User user = (User) req.getSession().getAttribute("webuser"); Answer answer = new Answer(); int rightnum = 0; int total = 0; for (String key : req.getParameterMap().keySet()) { total++;//from w ww. j a v a2 s .c om Long qid = Long.valueOf(key); Exam exam = this.examService.find(qid); if (exam.getRightoption().equals(req.getParameter(key))) rightnum++; System.out.println(qid + ",,," + req.getParameter(key)); } answer.setRightnum(rightnum); answer.setTotal(total); answer.setScore(rightnum * 100 / total); answer.setCreateDate(new Date()); answer.setUser(user); examService.saveAnswer(answer); model.addAttribute("tip", "???" + answer.getScore()); model.addAttribute("exams", examService.findAll()); return "web/exam"; }