@Override public final ResponseInt handleRequest(final RequestInt request) { // per richieste di servizi if (request.getType().equals(RequestType.SERVICE)) { String commandName = request.getRequest(); if (commandName.equals("login")) { return login(request); } try { ResponseInt response = null; Command command = commandFactory.getCommand(commandName, request); response = command.execute(); return response; } catch (NullPointerException e) { e.printStackTrace(); ApplicationControllerException ex = new ApplicationControllerException(e.getMessage()); ErrorHandler er = ErrorHandler.getIstance(); er.processError(ex.getClass(), ex, ErrorHandlerInt.FATAL); } // Per richieste di interfaccia } else if (request.getType().equals(RequestType.UI_VIEW)) { switch (request.getRequest()) { case "start": ComplexResponse<ViewTO> response = new ComplexResponse<ViewTO>(); ViewTO view = new ViewTO(); view.scene = dispatcher.start(); response.addParameter(view); return response; case "logout": logout(); break; default: dispatcher.toView(request.getRequest()); } } return null; }