@ExceptionHandler(Exception.class)
    @RequestMapping(value = "api/edit/server/{id}", method = RequestMethod.POST)
    public
    @ResponseBody
    ServerRedirect updateServer(Model model, @PathVariable int id,
                                @RequestParam(required = false) Boolean enabled) throws Exception {
        logger.info("updating Server");
        if (enabled != null) {
            if (enabled) {
                Client.enableHost(ServerRedirectService.getInstance().getRedirect(id).getSrcUrl());
            } else {
                Client.disableHost(ServerRedirectService.getInstance().getRedirect(id).getSrcUrl());
            }
        }
        return ServerRedirectService.getInstance().getRedirect(id);
    }
@ ExceptionHandler ( Exception . class ) @ RequestMapping ( value = "api/edit/server/{id}" , method = RequestMethod . POST ) public @ ResponseBody ServerRedirect updateServer ( Model model , @ PathVariable int id , @ RequestParam ( required = false ) Boolean enabled ) throws Exception { logger . info ( "updating Server" ) ; if ( enabled != null ) { if ( enabled ) { Client . enableHost ( ServerRedirectService . getInstance ( ) . getRedirect ( id ) . getSrcUrl ( ) ) ; } else { Client . disableHost ( ServerRedirectService . getInstance ( ) . getRedirect ( id ) . getSrcUrl ( ) ) ; } } return ServerRedirectService . getInstance ( ) . getRedirect ( id ) ; }
Updates the src url in the server redirects

@param model
@param id
@param enabled
@return
@throws Exception