How to use processRequest method of org.cerberus.servlet.crud.usermanagement.UpdateMyUserRobotPreference class

Best Cerberus-source code snippet using org.cerberus.servlet.crud.usermanagement.UpdateMyUserRobotPreference.processRequest

Source:UpdateMyUserRobotPreference.java Github

copy

Full Screen

...50 * @param response servlet response51 * @throws ServletException if a servlet-specific error occurs52 * @throws IOException if an I/O error occurs53 */54 protected void processRequest(HttpServletRequest request, HttpServletResponse response)55 throws ServletException, IOException {56 ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());57 IUserService userService = appContext.getBean(UserService.class);58 59 try {60 61 String ss_ip = ParameterParserUtil.parseStringParam(request.getParameter("ss_ip"), "");62 String ss_p = ParameterParserUtil.parseStringParam(request.getParameter("ss_p"), "");63 String platform = ParameterParserUtil.parseStringParam(request.getParameter("platform"), "");64 String browser = ParameterParserUtil.parseStringParam(request.getParameter("browser"), "");65 String version = ParameterParserUtil.parseStringParam(request.getParameter("version"), "");6667 User usr = userService.findUserByKey(request.getUserPrincipal().getName());68 usr.setRobotHost(ss_ip);69 usr.setRobotPort(ss_p);70 usr.setRobotPlatform(platform);71 usr.setRobotBrowser(browser);72 usr.setRobotVersion(version);73 74 userService.updateUser(usr);75 76 ILogEventService logEventService = appContext.getBean(LogEventService.class);77 logEventService.createForPrivateCalls("/UpdateMyUserRobotPreference", "UPDATE", "Update user robot preference for user: " + usr.getLogin(), request);7879 response.getWriter().print(usr.getLogin());80 } catch (CerberusException myexception) {81 response.getWriter().print(myexception.getMessageError().getDescription());82 }83 }8485 // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">86 /**87 * Handles the HTTP <code>GET</code> method.88 *89 * @param request servlet request90 * @param response servlet response91 * @throws ServletException if a servlet-specific error occurs92 * @throws IOException if an I/O error occurs93 */94 @Override95 protected void doGet(HttpServletRequest request, HttpServletResponse response)96 throws ServletException, IOException {97 processRequest(request, response);98 }99100 /**101 * Handles the HTTP <code>POST</code> method.102 *103 * @param request servlet request104 * @param response servlet response105 * @throws ServletException if a servlet-specific error occurs106 * @throws IOException if an I/O error occurs107 */108 @Override109 protected void doPost(HttpServletRequest request, HttpServletResponse response)110 throws ServletException, IOException {111 processRequest(request, response);112 }113114 /**115 * Returns a short description of the servlet.116 *117 * @return a String containing servlet description118 */119 @Override120 public String getServletInfo() {121 return "Short description";122 }// </editor-fold>123124}

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 UpdateMyUserRobotPreference

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful