IoT CAS Frameworks/IOT_Server/Server_Admin_Framework/source/ConsumerAPI/src/java/AV_Action/AV_UpdateResourceConfig.java
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        System.out.println(" AV_UpdateResourceConfig servlet");
        response.setContentType("application/json;charset=UTF-8");
        PrintWriter out = response.getWriter();
        String updateJson = null;
        boolean updated;
        try {
            updateJson = request.getParameter("resConfigReq");
            /* Commented by ananddw
            System.out.println("ResquestConfig==>"+updateJson);
            updated = UpdateResourceConfig.updateResourceConfig(request, updateJson);
            */
            Connection con = DatabaseConnection.getAVSAConnection(request);
            updated=new DeviceManagment().updateResourceConfig(con,updateJson);
            response.getWriter().write("" + updated);
            System.out.println("Result=>"+updated);
        } catch (Exception e) {
            e.printStackTrace();
            log.error("Error while reading the json");
        } finally {
            try {
                if (out != null) {
                    out.close();
                }
                if (updateJson != null) {
                    updateJson = null;
                }
            } catch (NullPointerException npe) {
                npe.printStackTrace();
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
    }
/**
     * Processes requests for both HTTP
     * <code>GET</code> and
     * <code>POST</code> methods.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
Processes requests for both HTTP
GET and
POST methods.

@param request servlet request
@param response servlet response
@throws ServletException if a servlet-specific error occurs
@throws IOException if an I/O error occurs
Processes requests for both HTTP GET and POST methods . @param request servlet request @param response servlet response @throws ServletException if a servlet - specific error occurs @throws IOException if an I / O error occurs
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        System.out.println(" AV_UpdateResourceConfig servlet");
        response.setContentType("application/json;charset=UTF-8");
        PrintWriter out = response.getWriter();
        String updateJson = null;
        boolean updated;
        try {
            updateJson = request.getParameter("resConfigReq");
            /* Commented by ananddw
            System.out.println("ResquestConfig==>"+updateJson);
            updated = UpdateResourceConfig.updateResourceConfig(request, updateJson);
            */
            Connection con = DatabaseConnection.getAVSAConnection(request);
            updated=new DeviceManagment().updateResourceConfig(con,updateJson);
            response.getWriter().write("" + updated);
            System.out.println("Result=>"+updated);
        } catch (Exception e) {
            e.printStackTrace();
            log.error("Error while reading the json");
        } finally {
            try {
                if (out != null) {
                    out.close();
                }
                if (updateJson != null) {
                    updateJson = null;
                }
            } catch (NullPointerException npe) {
                npe.printStackTrace();
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
    }
protected void processRequest ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { System . out . println ( " AV_UpdateResourceConfig servlet" ) ; response . setContentType ( "application/json;charset=UTF-8" ) ; PrintWriter out = response . getWriter ( ) ; String updateJson = null ; boolean updated ; try { updateJson = request . getParameter ( "resConfigReq" ) ; /* Commented by ananddw
            System.out.println("ResquestConfig==>"+updateJson);
            updated = UpdateResourceConfig.updateResourceConfig(request, updateJson);
            */ Connection con = DatabaseConnection . getAVSAConnection ( request ) ; updated = new DeviceManagment ( ) . updateResourceConfig ( con , updateJson ) ; response . getWriter ( ) . write ( "" + updated ) ; System . out . println ( "Result=>" + updated ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; log . error ( "Error while reading the json" ) ; } finally { try { if ( out != null ) { out . close ( ) ; } if ( updateJson != null ) { updateJson = null ; } } catch ( NullPointerException npe ) { npe . printStackTrace ( ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; } } }
Processes requests for both HTTP
 <code>GET</code> and
 <code>POST</code> methods.
Processes requests for both HTTP <code > GET< / code > and <code > POST< / code > methods .