How to use processRequest method of org.cerberus.servlet.crud.countryenvironment.findEnvironmentByCriteria class

Best Cerberus-source code snippet using org.cerberus.servlet.crud.countryenvironment.findEnvironmentByCriteria.processRequest

Source:findEnvironmentByCriteria.java Github

copy

Full Screen

...56 * @throws IOException if an I/O error occurs57 * @throws org.cerberus.exception.CerberusException58 * @throws org.json.JSONException59 */60 protected void processRequest(HttpServletRequest request, HttpServletResponse response)61 throws ServletException, IOException, CerberusException, JSONException {62 PolicyFactory policy = Sanitizers.FORMATTING.and(Sanitizers.LINKS);63 String system = policy.sanitize(request.getParameter("system"));64 String country = policy.sanitize(request.getParameter("country"));65 String application = policy.sanitize(request.getParameter("application"));66 67 ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());68 ICountryEnvParamService ceService = appContext.getBean(ICountryEnvParamService.class);6970 JSONArray array = new JSONArray();71 for (JSONObject ce : ceService.findActiveEnvironmentBySystemCountryApplication(system, country, application)) {72 array.put(ce);73 }74 response.setContentType("application/json");75 response.getWriter().print(array);76 }7778 // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">79 /**80 * Handles the HTTP <code>GET</code> method.81 *82 * @param request servlet request83 * @param response servlet response84 * @throws ServletException if a servlet-specific error occurs85 * @throws IOException if an I/O error occurs86 */87 @Override88 protected void doGet(HttpServletRequest request, HttpServletResponse response)89 throws ServletException, IOException {90 try {91 processRequest(request, response);92 } catch (CerberusException ex) {93 LOG.warn(ex);94 } catch (JSONException ex) {95 LOG.warn(ex);96 }97 }9899 /**100 * Handles the HTTP <code>POST</code> method.101 *102 * @param request servlet request103 * @param response servlet response104 * @throws ServletException if a servlet-specific error occurs105 * @throws IOException if an I/O error occurs106 */107 @Override108 protected void doPost(HttpServletRequest request, HttpServletResponse response)109 throws ServletException, IOException {110 try {111 processRequest(request, response);112 } catch (CerberusException ex) {113 LOG.warn(ex);114 } catch (JSONException ex) {115 LOG.warn(ex);116 }117 }118119 /**120 * Returns a short description of the servlet.121 *122 * @return a String containing servlet description123 */124 @Override125 public String getServletInfo() { ...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Cerberus-source automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in findEnvironmentByCriteria

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful