IoT CAS Frameworks/IOT_Server/Server_Admin_Framework/source/ConsumerAPI/src/java/AV_Action/AV_UpdateHostInfo.java
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("application/json;charset=UTF-8");
        PrintWriter out = response.getWriter();
        String hostJson = null;
        try {
            hostJson = request.getParameter("hostInfoConfig");
             System.out.println("hostInfoConfig-->>"+hostJson);
            boolean host = UpdateHostInfoConfig.updateHostInfo(request, hostJson);
            response.getWriter().write("" + host);
            System.out.println("Result==>"+host);
        } catch (Exception e) {
            e.printStackTrace();
            log.error("Error while reading the json");
        } finally {
            try {
                if (out != null) {
                    out.close();
                }
                if (hostJson != null) {
                    hostJson = 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 {
        response.setContentType("application/json;charset=UTF-8");
        PrintWriter out = response.getWriter();
        String hostJson = null;
        try {
            hostJson = request.getParameter("hostInfoConfig");
             System.out.println("hostInfoConfig-->>"+hostJson);
            boolean host = UpdateHostInfoConfig.updateHostInfo(request, hostJson);
            response.getWriter().write("" + host);
            System.out.println("Result==>"+host);
        } catch (Exception e) {
            e.printStackTrace();
            log.error("Error while reading the json");
        } finally {
            try {
                if (out != null) {
                    out.close();
                }
                if (hostJson != null) {
                    hostJson = null;
                }
            } catch (NullPointerException npe) {
                npe.printStackTrace();
            } catch (Exception ex) {
                ex.printStackTrace();
            }
        }
    }
protected void processRequest ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { response . setContentType ( "application/json;charset=UTF-8" ) ; PrintWriter out = response . getWriter ( ) ; String hostJson = null ; try { hostJson = request . getParameter ( "hostInfoConfig" ) ; System . out . println ( "hostInfoConfig-->>" + hostJson ) ; boolean host = UpdateHostInfoConfig . updateHostInfo ( request , hostJson ) ; response . getWriter ( ) . write ( "" + host ) ; System . out . println ( "Result==>" + host ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; log . error ( "Error while reading the json" ) ; } finally { try { if ( out != null ) { out . close ( ) ; } if ( hostJson != null ) { hostJson = 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 .