protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response)
            throws ServletException, IOException {

        ServletOperation operation = getOperation(request, Method.POST);

        if (operation != null) {
            try {

                ResourceHandle resource = getResource(request);
                operation.doIt(request, response, resource);

            } catch (RepositoryException ex) {
                LOG.error(ex.getMessage(), ex);
                if (response.isCommitted()) {
                    OutputStream log = response.getOutputStream();
                    log.write(ex.toString().getBytes(MappingRules.CHARSET));
                } else {
                    response.sendError(HttpServletResponse.SC_BAD_REQUEST, ex.toString());
                }
            }

        } else {
            sendInvalidOperation(request, response, Method.POST);
        }
    }
protected void doPost ( SlingHttpServletRequest request , SlingHttpServletResponse response ) throws ServletException , IOException { ServletOperation operation = getOperation ( request , Method . POST ) ; if ( operation != null ) { try { ResourceHandle resource = getResource ( request ) ; operation . doIt ( request , response , resource ) ; } catch ( RepositoryException ex ) { LOG . error ( ex . getMessage ( ) , ex ) ; if ( response . isCommitted ( ) ) { OutputStream log = response . getOutputStream ( ) ; log . write ( ex . toString ( ) . getBytes ( MappingRules . CHARSET ) ) ; } else { response . sendError ( HttpServletResponse . SC_BAD_REQUEST , ex . toString ( ) ) ; } } } else { sendInvalidOperation ( request , response , Method . POST ) ; } }
POST method