{"id":269831,"date":"2015-12-08T09:30:03","date_gmt":"2015-12-08T06:30:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=269831"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=269831","title":{"rendered":"Spring MVC\/Security, REST, Hibernate, Liquibase \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432 \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u043a\u0438"},"content":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/200\/413\/9d3\/2004139d3c1042a69ae608ca5422ee60.png\"\/><br \/>  \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432. \u041d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u043b\u0438\u0448\u044c JDK, \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438 \u0441\u0430\u043c \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f \u043d\u0430\u043b\u0435\u0442\u0443. \u041d\u0430\u0434\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u043f\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0434\u0432\u0443\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: \u0437\u0430\u043f\u0443\u0441\u043a \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 SQL \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e Java, Javascript \u0438 CSS \u0444\u0430\u0439\u043b\u043e\u0432, \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u043e\u0432. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Gradle, HSQLDB, Liquibase, Google closure compile \u0438 Gretty. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/h4>\n<p>  <\/p>\n<ul>\n<li><a href=\"#Introduction\">\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/a> <\/li>\n<li><a href=\"#Start\">\u041f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a> <\/li>\n<li><a href=\"#SpringMVC\">\u041a\u0430\u0440\u043a\u0430\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (Spring MVC)<\/a> <\/li>\n<li><a href=\"#ServerConfigurator\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 (Gretty)<\/a> <\/li>\n<li><a href=\"#Log\">\u041b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 (Logback)<\/a> <\/li>\n<li><a href=\"#HSQL\">\u0417\u0430\u043f\u0443\u0441\u043a \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 (HSQL)<\/a> <\/li>\n<li><a href=\"#Liquibase\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446 (liquibase)<\/a> <\/li>\n<li><a href=\"#LiquibaseDev\">\u0417\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u043c\u0438 (liquibase)<\/a> <\/li>\n<li><a href=\"#SpringSecurity\">\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 (Spring security)<\/a> <\/li>\n<li><a href=\"#SpringSecurityCustom\">\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432\u0445\u043e\u0434\u0430<\/a> <\/li>\n<li><a href=\"#Js\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 javascript<\/a> <\/li>\n<li><a href=\"#Css\">\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 css<\/a> <\/li>\n<li><a href=\"#Hibernate\">ORM (JPA\/Hibernate)<\/a><\/li>\n<li><a href=\"#Rest\">REST \u0441\u0435\u0440\u0432\u0438\u0441<\/a> <\/li>\n<\/ul>\n<p>  <a name=\"Introduction\"><\/a><\/p>\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>   \u041f\u043e\u043f\u044b\u0442\u0430\u0432\u0448\u0438\u0441\u044c \u0432 \u043d\u0435\u0434\u0430\u043b\u0435\u043a\u043e\u043c \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u043c Gradle, \u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u0443\u044e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c. \u041c\u043d\u043e\u0433\u043e \u0433\u0434\u0435 \u043f\u0438\u0448\u0443\u0442, \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0449\u0438. \u041d\u043e \u0446\u0435\u043b\u044c\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443. \u041f\u043e\u043f\u044b\u0442\u0430\u044e\u0441\u044c \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0432 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430\u0445 \u043f\u043e Gradle, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 \u0441\u0430\u043c\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0431\u0430\u0437\u0438\u0441 Java EE. <br \/>   \u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u043c \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432. \u041d\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043d\u0435\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0435\u0439 \u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043e\u043a.<br \/>   \u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0441 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438. \u041e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u2014 \u0442\u0440\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0438: \u043e\u0434\u043d\u0430 \u043a\u043e\u0440\u043d\u0435\u0432\u0430\u044f, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430\u044f \u0432\u0441\u0435\u043c, \u0434\u0440\u0443\u0433\u0430\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0440\u0430\u043d\u043d\u0438\u0446\u0430 \u0432\u0445\u043e\u0434\u0430, \u043e\u043d\u0430 \u0436\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041d\u0438\u0447\u0435\u0433\u043e \u0441\u0432\u0435\u0440\u0445 \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0438 \u043d\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0433\u043e. \u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u00abHello, world!\u00bb. \u041d\u043e \u0434\u0430\u0436\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0445\u0432\u0430\u0442\u0438\u0442, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u044e \u043c\u043e\u0449\u044c \u0438 \u0447\u0443\u0434\u043e\u0432\u0438\u0449\u043d\u043e\u0441\u0442\u044c Java EE. \u041f\u0440\u0438 \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u0447\u0438\u0441\u043b\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u0443\u0433\u0430\u044e\u0449\u0435\u0435 \u0432\u0435\u043b\u0438\u043a\u043e. <br \/>   \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0434\u0430\u043d\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043b\u0438\u0448\u044c \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435. \u0418 \u0434\u0435\u043b\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0432\u044b\u0431\u043e\u0440\u0435 Java \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044f\u0437\u044b\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0421\u0430\u043c\u043e \u043f\u043e \u0441\u0435\u0431\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e. \u0415\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b: \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u043e\u0432. \u0411\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0442\u044c, \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u0430\u0436\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435\u043c \u0436\u0435\u0441\u0442\u043a\u0438\u0445 \u0441\u0445\u0435\u043c.<br \/>   \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 JavaScript \u0438 CSS. \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0432\u0435\u0449\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c.  <\/p>\n<h4>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h4>\n<p>  <\/p>\n<ul>\n<li><a href=\"http:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/index.html\">JDK\/JRE<\/a> \u2014 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430 \u0434\u043b\u044f java.<\/li>\n<li><a href=\"https:\/\/www.jetbrains.com\/idea\/\">Idea<\/a> \u2014 \u0441\u0440\u0435\u0434\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/li>\n<li><a href=\"https:\/\/gradle.org\/\">Gradle<\/a> \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0431\u043e\u0440\u043a\u0438<\/li>\n<li><a href=\"https:\/\/spring.io\/\">Spring<\/a> \u2014 \u043a\u0430\u0440\u043a\u0430\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0434\u043b\u044f Java EE \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/li>\n<li><a href=\"http:\/\/hibernate.org\/\">Hibernate<\/a> \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f JPA<\/li>\n<li><a href=\"http:\/\/hsqldb.org\/\">hsqldb<\/a> \u2014 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/li>\n<li><a href=\"http:\/\/www.eclipse.org\/jetty\/\">Jetty<\/a> \u2014 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u043e\u0432<\/li>\n<li><a href=\"http:\/\/akhikhl.github.io\/gretty-doc\/Getting-started.html\">Gretty<\/a> \u2014 Gradle \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0438 \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432<\/li>\n<li><a href=\"https:\/\/github.com\/liquibase\/liquibase-gradle-plugin\">Liquibase<\/a> \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 sql \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432.<\/li>\n<li><a href=\"https:\/\/github.com\/eriwen\/gradle-js-plugin\">Gradle JS Plugin<\/a> \u2014 \u0441\u043b\u0438\u044f\u043d\u0438\u0435 \u0438 \u0441\u0436\u0430\u0442\u0438\u0435 javasript \u0444\u0430\u0439\u043b\u043e\u0432<\/li>\n<li><a href=\"https:\/\/github.com\/eriwen\/gradle-css-plugin\">Gradle CSS Plugin<\/a> \u2014 \u0441\u043b\u0438\u044f\u043d\u0438\u0435 \u0438 \u0441\u0436\u0430\u0442\u0438\u0435 css \u0444\u0430\u0439\u043b\u043e\u0432<\/li>\n<\/ul>\n<p>  \u0421\u043f\u0438\u0441\u043e\u043a \u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u043d\u043e \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u043b\u0438\u0448\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u0441\u0440\u0435\u0434\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043d\u043e \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0438 \u0431\u0435\u0437 \u043d\u0435\u0435, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u044c. <br \/>  <a name=\"Start\"><\/a><\/p>\n<h4>\u041f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h4>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0441\u043e\u0431\u0438\u0440\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Gradle. \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/dcd\/017\/bc7\/dcd017bc706c47878be1a0070a70ceb3\"\/><br \/>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0434\u0430\u0436\u0435 \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043d\u0435\u043c\u0430\u043b\u043e \u0444\u0430\u0439\u043b\u043e\u0432. \u0423\u0441\u043b\u043e\u0432\u043d\u043e \u043e\u043d\u0438 \u0434\u0435\u043b\u044f\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0435 \u0433\u0440\u0443\u043f\u043f\u044b. \u041e\u0434\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 (VCS), \u0434\u0440\u0443\u0433\u0438\u0435 \u043d\u0435\u0442. <br \/>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 VCS.  <\/p>\n<ul>\n<li>build.gradle \u2014 \u0444\u0430\u0439\u043b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043a\u0430\u043a \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442.<\/li>\n<li>settings.gradle \u2014 \u043e\u0431\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/li>\n<li>\u043f\u0430\u043f\u043a\u0430 src \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/li>\n<li>LICENSE.txt \u2014 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044f \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442 (\u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e ).<\/li>\n<li>gradlew, gradlew.bat, gradle-wrapper.jar \u0438 gradle-wrapper.properties \u2014 \u0441\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f gradle-wrapper. Wrapper \u044d\u0442\u043e \u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u0430\u044f \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0430 \u043d\u0430\u0434 gradle, \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u044e\u0449\u0430\u044f \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e (\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0432 gradle-wrapper.properties) \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 gradle \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.  <\/li>\n<\/ul>\n<p>   \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043d\u043e \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 VCS.  <\/p>\n<ul>\n<li>gradle.properties \u2014 \u0444\u0430\u0439\u043b \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 gradle (\u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e ).<\/li>\n<li>tit.iml \u2014 \u0444\u0430\u0439\u043b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 idea<\/li>\n<li>\u0421\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0435 \u043f\u0430\u043f\u043a\u0438 .gradle, build, out<\/li>\n<\/ul>\n<p>  \u0423 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432\u0435\u0440\u0441\u0438\u0439 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0439 \u0444\u0430\u0439\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a\u0438\u0435 \u043f\u0430\u043f\u043a\u0438\/\u0444\u0430\u0439\u043b\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 VCS. \u041e\u043d \u0441\u0430\u043c \u0442\u043e\u0436\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 VCS, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u043b\u043e\u0441\u044c \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u043e \u0443 \u0432\u0441\u0435\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f git, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 .gitignore \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">.gitignore<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">*.iml .idea\/ \/out\/ \/gradle.properties <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c Gretty \u0434\u043b\u044f Gradle, \u0443\u043c\u0435\u044e\u0449\u0438\u043c \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0438 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u043e\u0432. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u043b\u0430\u0433\u0438\u043d \u0432 \u0444\u0430\u0439\u043b\u0435 build.gradle.  <\/p>\n<pre><code class=\"bash\">plugins {   id &quot;org.akhikhl.gretty&quot; version &quot;1.2.4&quot; } <\/code><\/pre>\n<p>  \u0421 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0434\u043e \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b.  <\/p>\n<pre><code class=\"bash\">gradlew jettyStart <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u044f\u043c\u043e \u0438\u0437 Idea, \u0432\u044b\u0431\u0440\u0430\u0432 &#8216;jettyStart&#8217;. \u0412 \u0441\u043f\u0438\u0441\u043a\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0434\u043b\u044f gradle. \u041f\u043e \u044d\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0430\u0447\u0435\u043d\u0430 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u0430 9 \u0432\u0435\u0440\u0441\u0438\u044f jetty. \u041f\u0440\u043e\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"http:\/\/localhost:8080\/gull\/\">localhost:8080\/gull\/<\/a>. \u0414\u043b\u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f &#8216;jettyStop&#8217;. <br \/>  \u041d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 jettyRun, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d \u043d\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0438\u0437 Idea (\u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430). <br \/>  \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f &#8216;jettyStartDebug&#8217;   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0439<\/b><\/p>\n<div class=\"spoiler_text\">\u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 &#8216;jettyStartDebug&#8217; \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0436\u0434\u0430\u0442\u044c \u043f\u043e\u043a\u0430 \u043a \u043d\u0435\u043c\u0443 \u043d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 Idea \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u043d\u044e run-&gt;Edit Configuration <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/97b\/f13\/0d7\/97bf130d707342d5b1f54a5f999b3107\"\/><\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e &#8216;remote&#8217;. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u043c.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/918\/cb1\/67c\/918cb167cf754b3a8972f000cb01cb46\"\/> <br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0438 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443.  <\/div>\n<\/div>\n<p>  <a name=\"SpringMVC\"><\/a><\/p>\n<h4>Spring MVC<\/h4>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u043e\u0435\u043a\u0442 \u0443\u043c\u0435\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 &#8216;\u043a\u043e\u0440\u043d\u0435\u0432\u0443\u044e&#8217; \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443. \u0414\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f Spring MVC, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u043c \u043f\u0430\u0442\u0442\u0435\u0440\u043d <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Model-View-Controller\">\u043c\u043e\u0434\u0435\u043b\u044c-\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435-\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440<\/a>. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f JSP \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430, \u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u043c Java \u043a\u043b\u0430\u0441\u0441 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439 \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u044b\u0445.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/465\/816\/272\/4658162726be4d62bdc2dc8e7ca8e869\"\/>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<\/b><\/p>\n<div class=\"spoiler_text\">build.gradle.  <\/p>\n<pre><code class=\"bash\">dependencies {     compile group: 'org.springframework', name: 'spring-webmvc', version: gradle.springVersion } <\/code><\/pre>\n<p>  settings.gradle   <\/p>\n<pre><code class=\"bash\">gradle.ext.springVersion = '4.2.2.RELEASE' <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 spring-webmvc, \u043d\u0435\u044f\u0432\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0438 \u044f\u0434\u0440\u043e Spring, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0430\u043c\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u0442 \u043d\u0435\u0433\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u044f\u0434\u0440\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438 \u044f\u0432\u043d\u043e, \u0443\u043a\u0430\u0437\u0430\u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.   <\/p>\n<ul>\n<li>spring-core<\/li>\n<li>spring-beans<\/li>\n<li>spring-context<\/li>\n<\/ul>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u044f\u0434\u0440\u043e Spring \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u043e\u0437\u043d\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u0444\u0430\u0439\u043b\u044b \u0432 \u0435\u0434\u0438\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%92%D0%BD%D0%B5%D0%B4%D1%80%D0%B5%D0%BD%D0%B8%D0%B5_%D0%B7%D0%B0%D0%B2%D0%B8%D1%81%D0%B8%D0%BC%D0%BE%D1%81%D1%82%D0%B8\">\u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/a>. <br \/>  \u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 Spring \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u044f\u043c\u043e \u0432 <a href=\"http:\/\/habrahabr.ru\/post\/112488\/\">\u043a\u043e\u0434\u0435<\/a>. \u041c\u043d\u0435 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0447\u0443\u0440 \u0440\u0430\u0434\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c, \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0443\u043c\u0435\u0441\u0442\u043d\u0435\u0439 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 xml \u0444\u0430\u0439\u043b\u0430, \u0430 \u043d\u0435 \u043a\u043e\u0434\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0447\u0430\u0441\u0442\u044c \u0447\u0435\u0440\u0435\u0437 xml, \u0447\u0430\u0441\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438. <br \/>  \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432 web.xml. \u0422\u0430\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0442\u0440\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.  <\/p>\n<ul>\n<li>listener \u2014 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b ( \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e applicationContext.xml) <\/li>\n<li>servlet \u2014 \u041a\u043b\u0430\u0441\u0441 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/li>\n<li>servlet-mapping- \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0437\u0430 \u043a\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u043b\u0435\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0438 &#8216;\/&#8217; \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u044b \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043f\u0440\u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0438 &#8216;\/admin\/&#8217; \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 &#8216;admin&#8217;. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043d\u0430 \u043e\u0434\u0438\u043d \u043f\u0443\u0442\u044c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u043e\u0432 \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u044b\u0439 \u0442\u043e\u0447\u043d\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445.    <\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">web.xml<\/b><\/p>\n<div class=\"spoiler_text\">&lt;?xml version=\u00ab1.0\u00bb encoding=\u00abUTF-8\u00bb?&gt;<br \/>  &lt;web-app xmlns:xsi=\u00ab<a href=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\">www.w3.org\/2001\/XMLSchema-instance<\/a>\u00bb version=\u00ab2.4\u00bb<br \/>   xmlns=\u00ab<a href=\"http:\/\/java.sun.com\/xml\/ns\/j2ee\">java.sun.com\/xml\/ns\/j2ee<\/a>\u00bb<br \/>   xsi:schemaLocation=\u00ab<a href=\"http:\/\/java.sun.com\/xml\/ns\/j2ee\">java.sun.com\/xml\/ns\/j2ee<\/a> <a href=\"http:\/\/java.sun.com\/xml\/ns\/j2ee\/web-app_2_4.xsd\">java.sun.com\/xml\/ns\/j2ee\/web-app_2_4.xsd<\/a>\u00bb&gt;<\/p>\n<p>    &lt;servlet-name&gt;dispatcher&lt;\/servlet-name&gt;<br \/>   &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;\/servlet-class&gt;<br \/>   &lt;load-on-startup&gt;1&lt;\/load-on-startup&gt;<\/p>\n<p>  &lt;servlet-mapping&gt;<br \/>   &lt;servlet-name&gt;dispatcher&lt;\/servlet-name&gt;<br \/>   &lt;url-pattern&gt;\/&lt;\/url-pattern&gt;<br \/>   &lt;\/servlet-mapping&gt;<\/p>\n<p>   &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;\/listener-class&gt;<\/p>\n<p>  &lt;\/web-app&gt;  <\/div>\n<\/div>\n<p>  applicationContext.xml \u2014 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0431\u0438\u043d\u044b \u043e\u0431\u0449\u0438\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">applicationContext.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml  version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;beans xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;        xmlns=&quot;http:\/\/www.springframework.org\/schema\/beans&quot;        xsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd&quot;&gt;  &lt;\/beans&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  dispatcher-servlet.xml \u2014 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0431\u0438\u043d\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u0430. \u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a \u0436\u0435 \u043a\u0430\u043a \u0438 \u0441\u0435\u0440\u0432\u043b\u0435\u0442 \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c &#8216;-servlet.xml &#8216;. \u0414\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u043d\u043e\u0441\u0442\u0438 \u0432 \u0438\u043c\u0435\u043d\u0438 \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u2018\/\u2019. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u0443 \u2018<b>admin\/dispatcher<\/b>\u2019 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0444\u0430\u0439\u043b \u2018src\/main\/webapp\/WEB\u00adINF\/<b>admin\/dispatcher<\/b>-\u00adservlet.xml\u2019<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">dispatcher-servlet.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;beans xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;        xmlns:mvc=&quot;http:\/\/www.springframework.org\/schema\/mvc&quot;        xmlns:context=&quot;http:\/\/www.springframework.org\/schema\/context&quot;        xmlns=&quot;http:\/\/www.springframework.org\/schema\/beans&quot;        xsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd            http:\/\/www.springframework.org\/schema\/mvc http:\/\/www.springframework.org\/schema\/mvc\/spring-mvc.xsd            http:\/\/www.springframework.org\/schema\/context http:\/\/www.springframework.org\/schema\/context\/spring-context.xsd&quot;&gt;      &lt;!-- \u0431\u0438\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0433\u0434\u0435 \u043b\u0435\u0436\u0430\u0442 jsp \u0434\u043b\u044f view --&gt;     &lt;bean class=&quot;org.springframework.web.servlet.view.InternalResourceViewResolver&quot;&gt;         &lt;property name=&quot;prefix&quot; value=&quot;\/WEB-INF\/jsp\/&quot;\/&gt;         &lt;property name=&quot;suffix&quot; value=&quot;.jsp&quot;\/&gt;     &lt;\/bean&gt;      &lt;mvc:view-controller path=&quot;\/&quot; view-name=&quot;index&quot;\/&gt;      &lt;!--\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 mvc --&gt;     &lt;mvc:annotation-driven\/&gt;     &lt;!--\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 \u043a\u0430\u043a\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a --&gt;     &lt;context:component-scan base-package=&quot;com.intetm.web&quot;\/&gt;  &lt;\/beans&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 dispatcher-servlet.xml \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u0431\u0438\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0433\u0434\u0435 \u043b\u0435\u0436\u0430\u0442 JSP \u0434\u043b\u044f view. \u0423\u043a\u0430\u0437\u0430\u043d\u0430 \u043a\u043e\u0440\u043d\u0435\u0432\u0430\u044f (&quot;\/&quot;) \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0438 \u0442\u0430\u043a \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0441\u0442\u0440\u043e\u0447\u043a\u0430 &lt;mvc:annotation-driven\/&gt;&quot; \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0430\u044f \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 Spring-mvc. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e Spring \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0431\u0438\u043d\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u043a\u0430\u0436\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0430\u043a\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c. <br \/>  Spring \u0438\u0449\u0435\u0442 \u0432\u0441\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439  <a href=\"http:\/\/habrahabr.ru\/users\/controller\/\" class=\"user_link\">Controller<\/a>, \u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u044b \u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439  @RequestMapping. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u043c\u044f view. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 value \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0430\u0434\u0440\u0435\u0441.   <\/p>\n<pre><code class=\"java\">package com.intetm.web.login;  import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod;  @Controller public class LoginController {      private static final String HELLO_VIEW = &quot;hello&quot;;      @RequestMapping(value = &quot;\/hello&quot;, method = RequestMethod.GET)     public String hello(Model model) {         model.addAttribute(&quot;subject&quot;, &quot;world&quot;);         return HELLO_VIEW;     } } <\/code><\/pre>\n<p>  \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043c\u043e\u0434\u0435\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 view, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e &quot;${parametr_name}&quot;. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 hello.jsp.  <\/p>\n<pre><code class=\"xml\">&lt;%@ page contentType=&quot;text\/html;charset=UTF-8&quot; language=&quot;java&quot; %&gt; &lt;html&gt; &lt;head&gt;     &lt;title&gt;Title&lt;\/title&gt; &lt;\/head&gt; &lt;body&gt; Hello, ${subject}! &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  \u041d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443, \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">index.jsp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;%@ page contentType=&quot;text\/html;charset=UTF-8&quot; language=&quot;java&quot; %&gt; &lt;html&gt; &lt;head&gt;     &lt;title&gt;Title&lt;\/title&gt; &lt;\/head&gt; &lt;body&gt; &lt;a href=&quot;hello&quot;&gt;Hello&lt;\/a&gt; &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432, \u0441\u0442\u0430\u043d\u0435\u0442 \u0434\u0432\u0443\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<br \/>  <a name=\"ServerConfigurator\"><\/a><\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/h4>\n<p>  \u0425\u043e\u0442\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0438\u0445 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u0442\u044b, \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0430\u0439\u043b \u0432 classpath.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/1fa\/981\/22d\/1fa98122d75c43029b9d517870a2ff10\"\/><br \/>  \u0414\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e\u0440\u0442\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c gretty \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043f\u043e\u0440\u0442 \u0432 build.gradle.   <\/p>\n<pre><code class=\"bash\">def serverHttpPort = project.properties['serverHttpPort'] ?: gradle.serverHttpPort  gretty {     httpPort = serverHttpPort } <\/code><\/pre>\n<p>  \u0438 \u043f\u043e\u0440\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 settings.gradle  <\/p>\n<pre><code class=\"bash\">\/\/default config gradle.ext.serverHttpPort = 8080 <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0435\u0441\u043b\u0438 \u0432 gradle.properties \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f &#8216;serverHttpPort&#8217; \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u043d\u0430. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0437 settings.gradle. \u0422\u0430\u043a \u043a\u0430\u043a settings.gradle \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 git, \u0430 gradle.properties \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0438\u0437 \u043d\u0435\u0433\u043e \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0431\u0435\u0437 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u0441 git. <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c14\/79c\/126\/c1479c126fe6480ab54f8af5c6f023de\"\/><br \/>  \u0414\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0439\u0441\u044f \u0432 VCS \u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u0443\u044e \u043a\u043e\u043f\u0438\u044e. \u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0438 \u043e\u0431\u0449\u0435\u0439 \u043a\u043e\u043f\u0438\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 serverContextFile. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043e\u043f\u0438\u044f \u0438\u0437 VCS. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0442\u0440\u0435\u043d\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 \u0432 Gradle, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0443\u044e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043f\u0438\u044e. <br \/>  build.gradle.  <\/p>\n<pre><code class=\"bash\">def serverResourcesPath = project.properties['serverResourcesPath'] ?: gradle.serverResourcesPath def serverContextFile = project.properties['serverContextFile'] ?: gradle.serverContextFile  gretty {     httpPort = serverHttpPort     serverConfigFile = serverContextFile }  task copyEnvironment(type: Copy) {     from 'src\/test\/resources\/environment'     into serverResourcesPath } <\/code><\/pre>\n<p>  \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e settings.gradle  <\/p>\n<pre><code class=\"bash\">gradle.ext.serverResourcesPath = &quot;dev\/resources&quot; gradle.ext.serverContextFile = &quot;src\/test\/resources\/environment\/jetty-context.xml&quot;<\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0443\u0441\u0442\u043e\u0439 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f jetty<\/b><\/p>\n<div class=\"spoiler_text\">src\/test\/resources\/environment\/jetty-context.xml  <\/p>\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;!DOCTYPE Configure PUBLIC &quot;-\/\/Jetty\/\/Configure\/\/EN&quot; &quot;http:\/\/www.eclipse.org\/jetty\/configure_9_3.dtd&quot;&gt;  &lt;Configure id=&quot;ExampleServer&quot; class=&quot;org.eclipse.jetty.server.Server&quot;&gt;   &lt;\/Configure&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>   \u041a\u043e\u043f\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 dev\/resources. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043f\u0430\u043f\u043a\u0430 dev \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u043e\u0432 \u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u0432, \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u043c \u0432\u0441\u044e \u043f\u0430\u043f\u043a\u0443 dev \u0438\u0437 VCS.<\/p>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c classpath \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b &#8216;logback.xml&#8217; \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u043b\u043e\u0433\u043e\u0432.<br \/>  build.gradle.  <\/p>\n<pre><code class=\"bash\">def serverClassPath = [project.properties['serverClassPath'] ?: gradle.serverClassPath] as Set gretty {     \u2026     classPath = serverClassPath } <\/code><\/pre>\n<p>  settings.gradle  <\/p>\n<pre><code class=\"bash\">gradle.ext.serverClassPath = gradle.serverResourcesPath + &quot;\/classpath&quot; <\/code><\/pre>\n<p>  <a name=\"Log\"><\/a><\/p>\n<h4>\u041b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h4>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d81\/4c8\/019\/d814c801981440ddaa4092e0904d3e9d\"\/><br \/>   \u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 java \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e <a href=\"http:\/\/habrahabr.ru\/post\/113145\/\">\u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u0430\u044f \u0438 \u043f\u0435\u0447\u0430\u043b\u044c\u043d\u0430\u044f<\/a>. \u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u043a\u0430 \u0438\u0437 slf4j \u0438 logback. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 build.gradle \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0434\u0432\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.   <\/p>\n<pre><code class=\"bash\">dependencies {     compile group: 'org.slf4j', name: 'slf4j-api', version: gradle.slf4jVersion     runtime group: 'ch.qos.logback', name: 'logback-classic', version: gradle.logbackVersion \u2026 } <\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u0432 settings.gradle  <\/p>\n<pre><code class=\"bash\">gradle.ext.slf4jVersion = '1.7.13' gradle.ext.logbackVersion = '1.1.3' <\/code><\/pre>\n<p>  \u0414\u043b\u044f logback \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0444\u0430\u0439\u043b logback.xml \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043b\u043e\u0433\u0438. \u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b   <\/p>\n<ul>\n<li>Appender -\u00ad \u043a\u0430\u043d\u0430\u043b(\u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u0444\u0430\u0439\u043b \u0438\u043b\u0438 \u0447\u0442\u043e-\u00ad\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0435) \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0417\u0430\u0434\u0430\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443, \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u0440\u043e\u0442\u0430\u0446\u0438\u0438 \u0444\u0430\u0439\u043b\u043e\u0432.<\/li>\n<li>Root -\u00ad \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0441 \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u043d\u0435 \u043d\u0438\u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0438 \u043f\u0435\u0440\u0435\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0445 \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 appender.<\/li>\n<li>Logger \u2014 \u00ad\u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 root \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0432\u043d\u0443\u0442\u0440\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430. (\u041f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043a\u043b\u0430\u0441\u0441\u044b \u043b\u043e\u0433\u0438\u0440\u0443\u044e\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d\u0438 \u043b\u043e\u0433\u0433\u0435\u0440\u0430 \u043f\u043e\u043b\u043d\u043e\u0435 \u0438\u043c\u044f \u043a\u043b\u0430\u0441\u0441\u0430)<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 logback.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;!--suppress XmlUnboundNsPrefix --&gt; &lt;configuration xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;                xsi:noNamespaceSchemaLocation=&quot;http:\/\/www.padual.com\/java\/logback.xsd&quot;                scan=&quot;true&quot; scanPeriod=&quot;10 seconds&quot;&gt;      &lt;!-- \u0412\u044b\u0432\u043e\u0434 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c --&gt;     &lt;appender name=&quot;STDOUT&quot; class=&quot;ch.qos.logback.core.ConsoleAppender&quot;&gt;         &lt;filter class=&quot;ch.qos.logback.classic.filter.ThresholdFilter&quot;&gt;             &lt;!-- \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c error. Debug, info \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u0438\u0435 \u0443\u0440\u043e\u0432\u043d\u0438 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0443\u0442. --&gt;             &lt;level&gt;ERROR&lt;\/level&gt;         &lt;\/filter&gt;         &lt;encoder&gt;             &lt;pattern&gt;                 &lt;!--\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u043b\u043e\u0433\u043e\u0432. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0442\u0430, \u043f\u043e\u0442\u043e\u043c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043b\u043e\u0433\u0433\u0435\u0440\u0430 (\u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430) \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435--&gt;                 %d{yyyy-MM-dd HH:mm:ss} %-5level %logger{128} - %msg%n             &lt;\/pattern&gt;         &lt;\/encoder&gt;     &lt;\/appender&gt;      &lt;!-- \u0412\u044b\u0432\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u043e\u0442\u0430\u0446\u0438\u044f \u043b\u043e\u0433\u043e\u0432 --&gt;     &lt;appender name=&quot;ERROR_FILE&quot; class=&quot;ch.qos.logback.core.rolling.RollingFileAppender&quot;&gt;         &lt;!-- \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043b\u043e\u0433\u0438--&gt;         &lt;file&gt;dev\/logs\/error.log&lt;\/file&gt;         &lt;filter class=&quot;ch.qos.logback.classic.filter.ThresholdFilter&quot;&gt;             &lt;!-- \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c error. Debug, info \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u0438\u0435 \u0443\u0440\u043e\u0432\u043d\u0438 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0443\u0442. --&gt;             &lt;level&gt;ERROR&lt;\/level&gt;         &lt;\/filter&gt;         &lt;!-- \u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0440\u043e\u0442\u0430\u0446\u0438\u0438 \u043b\u043e\u0433\u043e\u0432. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u043b\u043e\u0433\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b--&gt;         &lt;rollingPolicy class=&quot;ch.qos.logback.core.rolling.TimeBasedRollingPolicy&quot;&gt;             &lt;fileNamePattern&gt;dev\/logs\/old\/%d{yyyy-MM-dd}.error.log&lt;\/fileNamePattern&gt;             &lt;maxHistory&gt;7&lt;\/maxHistory&gt;         &lt;\/rollingPolicy&gt;         &lt;encoder&gt;             &lt;pattern&gt;                 &lt;!--\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u043b\u043e\u0433\u043e\u0432. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0442\u0430, \u043f\u043e\u0442\u043e\u043c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043b\u043e\u0433\u0433\u0435\u0440\u0430 (\u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430) \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435--&gt;                 %d{yyyy-MM-dd HH:mm:ss} %-5level %logger{128} - %msg%n             &lt;\/pattern&gt;         &lt;\/encoder&gt;     &lt;\/appender&gt;      &lt;!-- \u0412\u044b\u0432\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u043e\u0442\u0430\u0446\u0438\u044f \u043b\u043e\u0433\u043e\u0432 --&gt;     &lt;appender name=&quot;DEBUG_FILE&quot; class=&quot;ch.qos.logback.core.rolling.RollingFileAppender&quot;&gt;         &lt;!-- \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043b\u043e\u0433\u0438--&gt;         &lt;file&gt;dev\/logs\/debug.log&lt;\/file&gt;         &lt;filter class=&quot;ch.qos.logback.classic.filter.ThresholdFilter&quot;&gt;             &lt;level&gt;DEBUG&lt;\/level&gt;         &lt;\/filter&gt;         &lt;!-- \u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0440\u043e\u0442\u0430\u0446\u0438\u0438 \u043b\u043e\u0433\u043e\u0432. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u043b\u043e\u0433\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b--&gt;         &lt;rollingPolicy class=&quot;ch.qos.logback.core.rolling.TimeBasedRollingPolicy&quot;&gt;             &lt;fileNamePattern&gt;dev\/logs\/old\/%d{yyyy-MM-dd}.debug.log&lt;\/fileNamePattern&gt;             &lt;maxHistory&gt;7&lt;\/maxHistory&gt;         &lt;\/rollingPolicy&gt;         &lt;encoder&gt;             &lt;pattern&gt;                 &lt;!--\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u043b\u043e\u0433\u043e\u0432. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0442\u0430, \u043f\u043e\u0442\u043e\u043c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043b\u043e\u0433\u0433\u0435\u0440\u0430 (\u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430) \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435--&gt;                 %d{yyyy-MM-dd HH:mm:ss} %-5level %logger{128} - %msg%n             &lt;\/pattern&gt;         &lt;\/encoder&gt;     &lt;\/appender&gt;      &lt;!-- \u0412\u044b\u0432\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b, \u041d\u0415 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u043e\u0442\u0430\u0446\u0438\u044f \u043b\u043e\u0433\u043e\u0432 --&gt;     &lt;appender name=&quot;SQL_FILE&quot; class=&quot;ch.qos.logback.core.FileAppender&quot;&gt;         &lt;!-- \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043b\u043e\u0433\u0438--&gt;         &lt;file&gt;dev\/logs\/sql.log&lt;\/file&gt;         &lt;filter class=&quot;ch.qos.logback.classic.filter.ThresholdFilter&quot;&gt;             &lt;level&gt;dev\/logs\/sql.lg&lt;\/level&gt;         &lt;\/filter&gt;         &lt;!-- \u041e\u0447\u0438\u0449\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435--&gt;         &lt;append&gt;false&lt;\/append&gt;         &lt;encoder&gt;             &lt;pattern&gt;                 &lt;!--\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u043e\u0440\u043c\u0430\u0442 \u0437\u0430\u043f\u0438\u0441\u0438 \u043b\u043e\u0433\u043e\u0432. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0442\u0430, \u043f\u043e\u0442\u043e\u043c \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043b\u043e\u0433\u0433\u0435\u0440\u0430 (\u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430) \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435--&gt;                 %d{yyyy-MM-dd HH:mm:ss} %-5level %logger{128} - %msg%n             &lt;\/pattern&gt;         &lt;\/encoder&gt;     &lt;\/appender&gt;      &lt;!-- \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0443\u0440\u043e\u0432\u043d\u044f DEBUG \u0438\u043b\u0438 \u0432\u044b\u0448\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u044b \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u043c \u0432\u043d\u0443\u0442\u0440\u044c \u043f\u0430\u043a\u0435\u0442\u0430 com.intetm \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 DEBUG_FILE --&gt;     &lt;logger name=&quot;com.intetm&quot; level=&quot;DEBUG&quot;&gt;         &lt;appender-ref ref=&quot;DEBUG_FILE&quot;\/&gt;     &lt;\/logger&gt;     &lt;!-- \u041b\u043e\u0433\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u044b hibernate--&gt;     &lt;logger name=&quot;org.hibernate.type&quot; level=&quot;ALL&quot;&gt;         &lt;appender-ref ref=&quot;SQL_FILE&quot;\/&gt;     &lt;\/logger&gt;     &lt;logger name=&quot;org.hibernate&quot; level=&quot;DEBUG&quot;&gt;         &lt;appender-ref ref=&quot;SQL_FILE&quot;\/&gt;     &lt;\/logger&gt;      &lt;!-- \u0412\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u043f\u0430\u043a\u0435\u0442\u0430 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438 ERROR_FILE--&gt;     &lt;root level=&quot;ERROR&quot;&gt;         &lt;appender-ref ref=&quot;STDOUT&quot;\/&gt;         &lt;appender-ref ref=&quot;ERROR_FILE&quot;\/&gt;     &lt;\/root&gt;  &lt;\/configuration&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0441 \u0437\u0430\u043f\u0438\u0441\u044c\u044e \u043b\u043e\u0433\u043e\u0432 \u0432 LoginController.  <\/p>\n<pre><code class=\"java\">logger.debug(&quot;hello page&quot;); <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.intetm.web.login;  import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod;  @Controller public class LoginController {     private static final Logger logger = LoggerFactory.getLogger(LoginController.class);      private static final String HELLO_VIEW = &quot;hello&quot;;      @RequestMapping(value = &quot;\/hello&quot;, method = RequestMethod.GET)     public String hello(Model model) {         logger.debug(&quot;hello page&quot;);         model.addAttribute(&quot;subject&quot;, &quot;world&quot;);         return HELLO_VIEW;     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442. \u0423\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u0445\u043e\u0434\u0435 <a href=\"http:\/\/localhost:8080\/gull\/hello\">localhost\/gull\/hello<\/a> \u0432 \u0444\u0430\u0439\u043b\u0435 dev\\log\\debug.log \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c.<br \/>  <a name=\"HSQL\"><\/a><\/p>\n<h4>\u0417\u0430\u043f\u0443\u0441\u043a \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/h4>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/baf\/5de\/335\/baf5de335fc247508cb443245ef26b5f\"\/><br \/>  \u0414\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u0445, \u043f\u0430\u0440\u043e\u043b\u044f\u0445, \u0440\u043e\u043b\u044f\u0445 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u044f\u043c\u043e \u0432 \u0441\u0430\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0438 \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u0438 \u043f\u0440\u043e\u0447\u0438\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e.<br \/>  Oracle \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 &#8216;\u0442\u044f\u0436\u0435\u043b\u044b\u0435&#8217; \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438. \u042d\u0442\u043e \u0438\u0445 \u043f\u043b\u0430\u0442\u0430 \u0437\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043e\u0433\u0440\u043e\u043c\u043d\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u0431\u043e\u0435\u0432\u043e\u0439 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438, \u0441 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0432 \u0434\u0435\u0441\u044f\u0442\u043a\u0438 \u0442\u044b\u0441\u044f\u0447 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u043a \u043d\u0435 \u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u0442\u044c\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 <a href=\"http:\/\/hsqldb.org\/\">HSQL<\/a>. <br \/>   HSQL \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0437 jar \u0444\u0430\u0439\u043b\u0430 \u0438\u043b\u0438 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u0438 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0437 Gradle. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u044f \u043d\u0435 \u043d\u0430\u0448\u0435\u043b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c HSQL \u0438\u0437 Gradle \u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0438 \u0432\u044b\u043d\u0435\u0441 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">database.gradle<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">apply plugin: 'java'  task startDatabase() {     group = 'develop'     outputs.upToDateWhen {         return !available()     }     doLast {         def dbUser = project.properties['dbUser'] ?: gradle.dbUser         def dbPassword = project.properties['dbPassword'] ?: gradle.dbPassword         def dbFile = project.properties['dbFile'] ?: gradle.dbFile         def dbName = project.properties['dbName'] ?: gradle.dbName          def className = &quot;org.hsqldb.server.Server&quot;;         def filePath = &quot;file:${projectDir}\/${dbFile};user=${dbUser};password=${dbPassword}&quot;;          def process = buildProcess(className, filePath, dbName)         wait(process)     } }  def buildProcess(className, filePath, dbName) {     def javaHome = System.getProperty(&quot;java.home&quot;);     def javaBin = javaHome + File.separator + &quot;bin&quot; + File.separator + &quot;java&quot;;     def classpath = project.buildscript.configurations.classpath.asPath;      def builder = new ProcessBuilder(javaBin, &quot;-cp&quot;, classpath, className, &quot;-database.0&quot;, filePath, &quot;-dbname.0&quot;, dbName);     builder.redirectErrorStream(true)     builder.directory(projectDir)     def process = builder.start()     process }  def wait(Process process) {     def ready = &quot;From command line, use [Ctrl]+[C] to abort abruptly&quot;     def reader = new BufferedReader(new InputStreamReader(process.getInputStream()))      def line;     while ((line = reader.readLine()) != null) {         logger.quiet line         if (line.contains(ready)) {             break;         }     } }   import groovy.sql.Sql  task stopDatabase() {     group = 'develop'     outputs.upToDateWhen {         return available()     }     doLast {         def dbUser = project.properties['dbUser'] ?: gradle.dbUser         def dbPassword = project.properties['dbPassword'] ?: gradle.dbPassword         def dbUrl = project.properties['dbUrl'] ?: gradle.dbUrl         def dbDrive = project.properties['dbDrive'] ?: gradle.dbDrive          ClassLoader loader = Sql.class.classLoader         project.buildscript.configurations.classpath.each { File file -&gt;             loader.addURL(file.toURI().toURL())         }         \/\/noinspection GroovyAssignabilityCheck         Sql sql = Sql.newInstance(dbUrl, dbUser, dbPassword, dbDrive) as Sql         sql.execute('SHUTDOWN;')         sql.close()     } }   boolean available() {     try {         int dbPort = project.properties['dbPort'] ?: gradle.dbPort as int         String dbHost = project.properties['dbHost'] ?: gradle.dbHost         Socket ignored = new Socket(dbHost, dbPort);         ignored.close();         return false;     }     catch (IOException ignored) {         return true;     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 build.gradle \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043b\u0438\u0448\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f hsql.  <\/p>\n<pre><code class=\"bash\">buildscript {     repositories {         mavenLocal()         mavenCentral()         jcenter()     }     dependencies {         classpath group: 'org.hsqldb', name: 'hsqldb', version: gradle.hsqldbVersion     } } \u2026 apply from: 'database.gradle' <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">settings.gradle<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">\/\/lib version gradle.ext.hsqldbVersion = '2.3.2' \/\/default database config gradle.ext.dbName = &quot;xdb&quot; gradle.ext.dbFile = &quot;dev\/database\/devDB&quot; gradle.ext.dbUser = &quot;SA&quot; gradle.ext.dbPassword = &quot;password&quot; gradle.ext.dbPort = 9001 gradle.ext.dbHost = &quot;localhost&quot; gradle.ext.dbUrl = &quot;jdbc:hsqldb:hsql:\/\/${gradle.dbHost}:${gradle.dbPort}\/${gradle.dbName}&quot; gradle.ext.dbDrive = &quot;org.hsqldb.jdbc.JDBCDriver&quot; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u043d\u044e \u0437\u0430\u0434\u0430\u0447 Gradle \u0432 Idea   <\/p>\n<pre><code class=\"bash\">gradlew startDatabase <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043b\u044e\u0431\u043e\u0439 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0447\u0435\u0440\u0435\u0437 Idea. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\/\u043f\u0430\u0440\u043e\u043b\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u00abSA\u00bb\/\u00abpassword\u00bb. \u0410\u0434\u0440\u0435\u0441 \u2014 jdbc:hsqldb:hsql:\/\/localhost:9001\/xdb <br \/>  \u0412\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e.  <\/p>\n<pre><code class=\"bash\">gradlew stopDatabase <\/code><\/pre>\n<p>  <a name=\"Liquibase\"><\/a><\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446<\/h4>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d5a\/943\/d48\/d5a943d4821244e893a25c460ebca618\"\/><br \/>  \u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0438 \u043f\u0440\u043e\u0447\u0438\u0435. \u041d\u0435\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0436\u0435\u0441\u0442\u043a\u043e\u0439 \u0441\u0445\u0435\u043c\u044b \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u0440\u0430\u0437\u0443. \u041d\u043e \u0441\u0430\u043c\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0438 \u0432 \u0442\u043e\u043c \u0438 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435. <br \/>   \u0414\u043b\u044f \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f SQL \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f Liquibase. Liquibase \u0443\u043c\u0435\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0441\u043b\u0435\u0434\u0438\u0442 \u0437\u0430 \u0442\u0435\u043c \u0447\u0442\u043e\u0431\u044b \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u0434\u0432\u0430\u0436\u0434\u044b. \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442 \u043e\u0431 \u043e\u043f\u0430\u0441\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b \u0441 \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0442\u043a\u0430\u0442\u044b \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0438\u043b\u0438 \u043f\u0435\u0440\u0438\u043e\u0434. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 Liquibase \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0441\u044f \u0447\u0438\u0441\u043b\u043e \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445: \u0431\u043e\u0435\u0432\u043e\u0439, \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0438 \u0442.\u0434.<br \/>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c liquibase, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0440\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b, \u043a\u0443\u0434\u0430 \u043f\u0440\u043e\u043b\u0438\u0432\u0430\u0442\u044c \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443.<br \/>  build.gradle  <\/p>\n<pre><code class=\"bash\">plugins {     id 'org.liquibase.gradle' version '1.1.1' }  def dbUser = project.properties['dbUser'] ?: gradle.dbUser def dbPassword = project.properties['dbPassword'] ?: gradle.dbPassword def dbUrl = project.properties['dbUrl'] ?: gradle.dbUrl  liquibase {     activities {         \/\/noinspection GroovyAssignabilityCheck         main {             changeLogFile 'src\/sql\/main\/changelog.xml'             url dbUrl             username dbUser             password dbPassword         }     } } task updateDbMain(dependsOn: startDatabase) {     group = 'develop'     doLast {         liquibase.runList = 'main'         tasks.update.execute()     } } <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">buildscript {     repositories {         mavenLocal()         mavenCentral()         jcenter()     }     dependencies {         classpath group: 'org.hsqldb', name: 'hsqldb', version: gradle.hsqldbVersion     } }  plugins {     id &quot;org.akhikhl.gretty&quot; version &quot;1.2.4&quot;     id 'org.liquibase.gradle' version '1.1.1' }  group 'com.intetm' version '0.1'  apply plugin: 'java' apply plugin: 'war' apply from: 'database.gradle'  \/\/noinspection GroovyUnusedAssignment sourceCompatibility = 1.8  repositories {     mavenCentral() }  dependencies {     compile group: 'org.springframework', name: 'spring-webmvc', version: gradle.springVersion      compile group: 'org.slf4j', name: 'slf4j-api', version: gradle.slf4jVersion     runtime group: 'ch.qos.logback', name: 'logback-classic', version: gradle.logbackVersion }  def serverHttpPort = project.properties['serverHttpPort'] ?: gradle.serverHttpPort def serverResourcesPath = project.properties['serverResourcesPath'] ?: gradle.serverResourcesPath def serverContextFile = project.properties['serverContextFile'] ?: gradle.serverContextFile def serverClassPath = [project.properties['serverClassPath'] ?: gradle.serverClassPath] as Set def dbUser = project.properties['dbUser'] ?: gradle.dbUser def dbPassword = project.properties['dbPassword'] ?: gradle.dbPassword def dbUrl = project.properties['dbUrl'] ?: gradle.dbUrl  gretty {     httpPort = serverHttpPort     serverConfigFile = serverContextFile     classPath = serverClassPath }  task copyEnvironment(type: Copy) {     group = 'develop'     from 'src\/test\/resources\/environment'     into serverResourcesPath }  liquibase {     activities {         \/\/noinspection GroovyAssignabilityCheck         main {             changeLogFile 'src\/sql\/main\/changelog.xml'             url dbUrl             username dbUser             password dbPassword         }     } } task updateDbMain(dependsOn: startDatabase) {     group = 'develop'     doLast {         liquibase.runList = 'main'         tasks.update.execute()     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0444\u0430\u0439\u043b changelog.xml \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c.<br \/>  \u041f\u043e \u0441\u043e\u0432\u0435\u0442\u0443 \u0438\u0437 <a href=\"http:\/\/habrahabr.ru\/post\/179425\/\">\u0441\u0442\u0430\u0442\u044c\u0438<\/a> \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432  <\/p>\n<pre><code class=\"bash\">\/src     \/sql         \/main               \/changelog.xml                         \/v-1.0                 \/2015.11.28_01_Create_User_table.sql                 ...                 \/changelog-v.1.0-cumulative.xml             \/v-2.0                 ...                 \/changelog-v.2.0-cumulative.xml <\/code><\/pre>\n<p>  \u0412 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0444\u0430\u0439\u043b changelog.xml \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0443\u043c\u0443\u043b\u044f\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043e\u0442 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">changelog.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;databaseChangeLog         xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;         xmlns=&quot;http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog&quot;         xsi:schemaLocation=&quot;http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog\/dbchangelog-3.1.xsd&quot;&gt;      &lt;include file=&quot;src\/sql\/main\/V-1.0\/changelog-v.1.0-cumulative.xml&quot;\/&gt;  &lt;\/databaseChangeLog&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u0444\u0430\u0439\u043b changelog-v.1.0-cumulative.xml \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043b\u044f 1 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">changelog-v.1.0-cumulative.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;databaseChangeLog         xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;         xmlns=&quot;http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog&quot;         xsi:schemaLocation=&quot;http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog\/dbchangelog-3.1.xsd&quot;&gt;      &lt;changeSet id=&quot;Version 1 tag&quot; author=&quot;Sivodedov Dmitry&quot;&gt;         &lt;tagDatabase tag=&quot;Version 1&quot;\/&gt;     &lt;\/changeSet&gt;     &lt;include file=&quot;src\/sql\/main\/V-1.0\/2015.11.28_01_Create_User_table.sql&quot;\/&gt;  &lt;\/databaseChangeLog&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0436\u0435 \u0441\u043f\u0438\u0441\u043a\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u043d\u0438\u0437\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">2015.11.28_01_Create_User_table.sql<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">--liquibase formatted sql --changeset Sivodedov Dmitry:CREATE_TABLE_Users CREATE TABLE Users (   id       BINARY(16)             NOT NULL PRIMARY KEY,   username VARCHAR_IGNORECASE(50) NOT NULL,   password VARCHAR(60)            NOT NULL,   enabled  BOOLEAN                NOT NULL ); --rollback drop table Users;  --changeset Sivodedov Dmitry:CREATE_TRIGGER_TRIG_BI_DM_USERS splitStatements:false CREATE TRIGGER TRIG_BI_DM_USERS BEFORE INSERT ON Users   REFERENCING NEW AS NEW FOR EACH ROW   BEGIN ATOMIC     IF NEW.id IS NULL     THEN       -- noinspection SqlResolve       SET NEW.id = UUID();     END IF;   END;  --rollback drop TRIGGER TRIG_BI_DM_USERS on Users;  --changeset Sivodedov Dmitry:CREATE_TABLE_Authorities CREATE TABLE Authorities (   id        BIGINT IDENTITY        NOT NULL PRIMARY KEY,   userId    BINARY(16)             NOT NULL,   authority VARCHAR_IGNORECASE(50) NOT NULL,   CONSTRAINT fk_authorities_users FOREIGN KEY (userId) REFERENCES users (id) ); --rollback drop table Authorities;  --changeset Sivodedov Dmitry:CREATE_INDEX_ix_auth_username CREATE UNIQUE INDEX ix_auth_username ON Authorities (userId, authority); --rollback drop INDEX ix_auth_username on Authorities; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 &#8216;updateDbMain&#8217;, \u043e\u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0441\u0442\u0430\u043d\u0443\u0442 \u0434\u0432\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/9da\/033\/79c\/9da03379cb7b4ba3a27c7ccc88bd1fc2\"\/><\/p>\n<p>  <a name=\"LiquibaseDev\"><\/a><\/p>\n<h4>\u0417\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/h4>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/625\/588\/fe5\/625588fe59a2451bab8640a306d3444b\"\/><br \/>   \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u0437\u0430\u0434\u0430\u0447\u0443, \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u044e\u0449\u0443\u044e \u043d\u0430 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u042d\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u0443\u0441\u0442\u043e\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0430 \u043d\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 SQL \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432. <br \/>  \u041d\u043e\u0432\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0438 \u0435\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 build.gradle  <\/p>\n<pre><code class=\"bash\">liquibase {     activities {         \u2026         dev {             changeLogFile 'src\/sql\/dev\/changelog.xml'             url dbUrl             username dbUser             password dbPassword         }     } }  task updateDbDev(dependsOn: startDatabase) {     group = 'develop'     doLast {         liquibase.runList = 'main, dev'         tasks.update.execute()     } } <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">buildscript {     repositories {         mavenLocal()         mavenCentral()         jcenter()     }     dependencies {         classpath group: 'org.hsqldb', name: 'hsqldb', version: gradle.hsqldbVersion     } }  plugins {     id &quot;org.akhikhl.gretty&quot; version &quot;1.2.4&quot;     id 'org.liquibase.gradle' version '1.1.1' }  group 'com.intetm' version '0.1'  apply plugin: 'java' apply plugin: 'war' apply from: 'database.gradle'  \/\/noinspection GroovyUnusedAssignment sourceCompatibility = 1.8  repositories {     mavenCentral() }  dependencies {     compile group: 'org.springframework', name: 'spring-webmvc', version: gradle.springVersion      compile group: 'org.slf4j', name: 'slf4j-api', version: gradle.slf4jVersion     runtime group: 'ch.qos.logback', name: 'logback-classic', version: gradle.logbackVersion }  def serverHttpPort = project.properties['serverHttpPort'] ?: gradle.serverHttpPort def serverResourcesPath = project.properties['serverResourcesPath'] ?: gradle.serverResourcesPath def serverContextFile = project.properties['serverContextFile'] ?: gradle.serverContextFile def serverClassPath = [project.properties['serverClassPath'] ?: gradle.serverClassPath] as Set def dbUser = project.properties['dbUser'] ?: gradle.dbUser def dbPassword = project.properties['dbPassword'] ?: gradle.dbPassword def dbUrl = project.properties['dbUrl'] ?: gradle.dbUrl  gretty {     httpPort = serverHttpPort     serverConfigFile = serverContextFile     classPath = serverClassPath }  task copyEnvironment(type: Copy) {     group = 'develop'     from 'src\/test\/resources\/environment'     into serverResourcesPath }  liquibase {     activities {         \/\/noinspection GroovyAssignabilityCheck         main {             changeLogFile 'src\/sql\/main\/changelog.xml'             url dbUrl             username dbUser             password dbPassword         }         dev {             changeLogFile 'src\/sql\/dev\/changelog.xml'             url dbUrl             username dbUser             password dbPassword         }     } } task updateDbMain(dependsOn: startDatabase) {     group = 'develop'     doLast {         liquibase.runList = 'main'         tasks.update.execute()     } }  task updateDbDev(dependsOn: startDatabase) {     group = 'develop'     doLast {         liquibase.runList = 'main, dev'         tasks.update.execute()     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">changelog.xml<\/b><\/p>\n<div class=\"spoiler_text\">src\\sql\\dev\\changelog.xml  <\/p>\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;databaseChangeLog         xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;         xmlns=&quot;http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog&quot;         xsi:schemaLocation=&quot;http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog\/dbchangelog-3.1.xsd&quot;&gt;      &lt;include file=&quot;src\/sql\/dev\/V-1.0\/2015.11.28_01_Create_User.sql&quot;\/&gt;   &lt;\/databaseChangeLog&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043f\u0438\u0441\u043e\u043a \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">changelog-v.1.0-cumulative.xml<\/b><\/p>\n<div class=\"spoiler_text\">src\\sql\\dev\\V-1.0\\changelog-v.1.0-cumulative.xml  <\/p>\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;databaseChangeLog         xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;         xmlns=&quot;http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog&quot;         xsi:schemaLocation=&quot;http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog http:\/\/www.liquibase.org\/xml\/ns\/dbchangelog\/dbchangelog-3.1.xsd&quot;&gt;      &lt;include file=&quot;src\/sql\/dev\/V-1.0\/2015.11.28_01_Create_User.sql&quot;\/&gt;   &lt;\/databaseChangeLog&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">2015.11.28_01_Create_User.sql<\/b><\/p>\n<div class=\"spoiler_text\">sql\\dev\\V-1.0\\2015.11.28_01_Create_User.sql  <\/p>\n<pre><code class=\"sql\">--liquibase formatted sql --changeset Sivodedov Dmitry:Create_User INSERT INTO USERS VALUES   ('8a59d9547e5b4d9ca0a30804e8a33a94', 'admin', '$2a$10$GZtUdy1Z7Hpk0lYYG92CQeiW1f2c4e3XgA8wunVTDFyQJ2DAmH.x.', TRUE); INSERT INTO AUTHORITIES VALUES (1, '8a59d9547e5b4d9ca0a30804e8a33a94', 'ROLE_ADMIN'); INSERT INTO AUTHORITIES VALUES (2, '8a59d9547e5b4d9ca0a30804e8a33a94', 'ROLE_USER'); --rollback delete from AUTHORITIES where userId = '8a59d9547e5b4d9ca0a30804e8a33a94'; --rollback delete from USERS where id = '8a59d9547e5b4d9ca0a30804e8a33a94'; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a name=\"SpringSecurity\"><\/a><\/p>\n<h4>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/h4>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/187\/c4c\/ded\/187c4cded513475ba30ed345d31e5605\"\/><br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 Spring \u2014 Spring Security.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c Spring Security<\/b><\/p>\n<div class=\"spoiler_text\">build.gradle  <\/p>\n<pre><code class=\"bash\">dependencies {     runtime group: 'org.springframework', name: 'spring-jdbc', version: gradle.springVersion        runtime group: 'org.springframework.security', name: 'spring-security-web', version: gradle.springSecurityVersion     runtime group: 'org.springframework.security', name: 'spring-security-config', version: gradle.springSecurityVersion      \/\/ \u0414\u0440\u0430\u0439\u0432\u0435\u0440\u044b \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 gretty.     \/\/ \u0415\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u0442\u043e \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0434\u0440\u0430\u0439\u0432\u0435\u0440 \u0432 classpath \u0441\u0435\u0440\u0432\u0435\u0440\u0430.     gretty group: 'org.hsqldb', name: 'hsqldb', version: gradle.hsqldbVersion   } <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">buildscript {     repositories {         mavenLocal()         mavenCentral()         jcenter()     }     dependencies {         classpath group: 'org.hsqldb', name: 'hsqldb', version: gradle.hsqldbVersion     } }  plugins {     id &quot;org.akhikhl.gretty&quot; version &quot;1.2.4&quot;     id 'org.liquibase.gradle' version '1.1.1' }  group 'com.intetm' version '0.1'  apply plugin: 'java' apply plugin: 'war' apply from: 'database.gradle'  \/\/noinspection GroovyUnusedAssignment sourceCompatibility = 1.8  repositories {     mavenCentral() }  dependencies {     runtime group: 'org.springframework', name: 'spring-jdbc', version: gradle.springVersion     compile group: 'org.springframework', name: 'spring-webmvc', version: gradle.springVersion      runtime group: 'org.springframework.security', name: 'spring-security-web', version: gradle.springSecurityVersion     runtime group: 'org.springframework.security', name: 'spring-security-config', version: gradle.springSecurityVersion      compile group: 'org.slf4j', name: 'slf4j-api', version: gradle.slf4jVersion     runtime group: 'ch.qos.logback', name: 'logback-classic', version: gradle.logbackVersion      gretty group: 'org.hsqldb', name: 'hsqldb', version: gradle.hsqldbVersion }  def serverHttpPort = project.properties['serverHttpPort'] ?: gradle.serverHttpPort def serverResourcesPath = project.properties['serverResourcesPath'] ?: gradle.serverResourcesPath def serverContextFile = project.properties['serverContextFile'] ?: gradle.serverContextFile def serverClassPath = [project.properties['serverClassPath'] ?: gradle.serverClassPath] as Set def dbUser = project.properties['dbUser'] ?: gradle.dbUser def dbPassword = project.properties['dbPassword'] ?: gradle.dbPassword def dbUrl = project.properties['dbUrl'] ?: gradle.dbUrl  gretty {     httpPort = serverHttpPort     serverConfigFile = serverContextFile     classPath = serverClassPath }  task copyEnvironment(type: Copy) {     group = 'develop'     from 'src\/test\/resources\/environment'     into serverResourcesPath }  liquibase {     activities {         \/\/noinspection GroovyAssignabilityCheck         main {             changeLogFile 'src\/sql\/main\/changelog.xml'             url dbUrl             username dbUser             password dbPassword         }         dev {             changeLogFile 'src\/sql\/dev\/changelog.xml'             url dbUrl             username dbUser             password dbPassword         }     } } task updateDbMain(dependsOn: startDatabase) {     group = 'develop'     doLast {         liquibase.runList = 'main'         tasks.update.execute()     } }  task updateDbDev(dependsOn: startDatabase) {     group = 'develop'     doLast {         liquibase.runList = 'main, dev'         tasks.update.execute()     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  settings.gradle  <\/p>\n<pre><code class=\"bash\">gradle.ext.springSecurityVersion = '4.0.2.RELEASE' <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 \u0444\u0430\u0439\u043b\u0435 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 spring security \u0441\u043e\u0437\u0434\u0430\u0435\u043c authentication-manager. \u0414\u043b\u044f \u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0442\u043e\u0439\u043a\u0438\u0439 BCrypt. \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043a\u0430 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u0434\u0432\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 SQL \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430\u043c\u0438.<\/p>\n<ul>\n<li>users-by-username-query \u2014 \u041f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 (\u0438\u043c\u044f, \u043f\u0430\u0440\u043e\u043b\u044c, \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430), \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0439\u0434\u0435\u043d. \u0418\u043d\u0430\u0447\u0435 \u043d\u0438\u0447\u0435\u0433\u043e. <\/li>\n<li>authorities-by-username-query \u2014 \u041f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u0440 (\u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0440\u043e\u043b\u044c).<\/li>\n<\/ul>\n<p>  \u041d\u0435\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0440\u043e\u043b\u044c &#8216;ANONYMOUS&#8217;. <br \/>  \u041a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 hello \u043f\u043e\u043b\u0443\u0447\u0430\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0441 \u0440\u043e\u043b\u044c\u044e USER. \u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \u0412 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u043e\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0438\u0448\u0435\u0442\u0441\u044f, \u043a\u0430\u043a ROLE_USER, \u043d\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e &#8216;USER&#8217;.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">security.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;beans:beans xmlns:beans=&quot;http:\/\/www.springframework.org\/schema\/beans&quot;              xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;              xmlns=&quot;http:\/\/www.springframework.org\/schema\/security&quot;              xsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans                  http:\/\/www.springframework.org\/schema\/beans\/spring-beans-4.0.xsd                  http:\/\/www.springframework.org\/schema\/security                   http:\/\/www.springframework.org\/schema\/security\/spring-security-4.0.xsd&quot;&gt;       &lt;http&gt;         &lt;intercept-url pattern=&quot;\/hello**&quot; access=&quot;hasRole('USER')&quot;\/&gt;          &lt;form-login default-target-url=&quot;\/&quot;\/&gt;         &lt;logout logout-url=&quot;\/logout&quot; logout-success-url=&quot;\/&quot;\/&gt;         &lt;anonymous username=&quot;guest&quot; granted-authority=&quot;ANONYMOUS&quot;\/&gt;         &lt;http-basic\/&gt;         &lt;remember-me\/&gt;     &lt;\/http&gt;       &lt;authentication-manager&gt;         &lt;authentication-provider&gt;             &lt;password-encoder ref=&quot;encoder&quot;\/&gt;             &lt;jdbc-user-service data-source-ref=&quot;dbDataSource&quot;                                users-by-username-query=&quot;SELECT username, password, enabled FROM Users WHERE username= ?&quot;                                authorities-by-username-query=&quot;SELECT u1.username, u2.authority FROM Users u1, Authorities u2 WHERE u1.id = u2.userId AND u1.UserName = ?&quot;\/&gt;         &lt;\/authentication-provider&gt;     &lt;\/authentication-manager&gt;      &lt;beans:bean id=&quot;encoder&quot; class=&quot;org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder&quot;&gt;         &lt;beans:constructor-arg name=&quot;strength&quot; value=&quot;10&quot;\/&gt;     &lt;\/beans:bean&gt;  &lt;\/beans:beans&gt;  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e spring \u0441\u043c\u043e\u0433 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. <br \/>  \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0431\u0438\u043d \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">dbContext.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;beans xmlns:jee=&quot;http:\/\/www.springframework.org\/schema\/jee&quot;        xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;        xmlns=&quot;http:\/\/www.springframework.org\/schema\/beans&quot;        xsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd                            http:\/\/www.springframework.org\/schema\/jee http:\/\/www.springframework.org\/schema\/jee\/spring-jee.xsd&quot;&gt;     &lt;jee:jndi-lookup id=&quot;dbDataSource&quot;                      jndi-name=&quot;jdbc\/Database&quot;                      expected-type=&quot;javax.sql.DataSource&quot;\/&gt;  &lt;\/beans&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 spring securuty \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">applicationContext.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml  version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;beans xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;        xmlns=&quot;http:\/\/www.springframework.org\/schema\/beans&quot;        xsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd&quot;&gt;      &lt;import resource=&quot;security.xml&quot;\/&gt;     &lt;import resource=&quot;dbContext.xml&quot;\/&gt;  &lt;\/beans&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043a\u043e\u043d\u043d\u0435\u043a\u0442 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440. \u0424\u0438\u043b\u044c\u0442\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0435\u0449\u0435 \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043f\u0430\u0434\u0435\u0442 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u044b.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">web.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;web-app xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; version=&quot;2.4&quot;          xmlns=&quot;http:\/\/java.sun.com\/xml\/ns\/j2ee&quot;          xsi:schemaLocation=&quot;http:\/\/java.sun.com\/xml\/ns\/j2ee http:\/\/java.sun.com\/xml\/ns\/j2ee\/web-app.xsd&quot;&gt;      &lt;!--Security--&gt;     &lt;!-- \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0438\u043b\u044c\u0442\u0440 springSecurityFilterChain \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f--&gt;     &lt;filter&gt;         &lt;filter-name&gt;springSecurityFilterChain&lt;\/filter-name&gt;         &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;\/filter-class&gt;     &lt;\/filter&gt;     &lt;!-- \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0447\u0442\u043e \u0444\u0438\u043b\u044c\u0442\u0440 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c springSecurityFilterChain \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0435 \u043f\u043e\u0434 \u043c\u0430\u0441\u043a\u0443 \/*--&gt;     &lt;filter-mapping&gt;         &lt;filter-name&gt;springSecurityFilterChain&lt;\/filter-name&gt;         &lt;url-pattern&gt;\/*&lt;\/url-pattern&gt;     &lt;\/filter-mapping&gt;     &lt;!--Security--&gt;      &lt;!--DispatcherServlet--&gt;     &lt;servlet&gt;         &lt;servlet-name&gt;dispatcher&lt;\/servlet-name&gt;         &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;\/servlet-class&gt;         &lt;load-on-startup&gt;1&lt;\/load-on-startup&gt;     &lt;\/servlet&gt;      &lt;servlet-mapping&gt;         &lt;servlet-name&gt;dispatcher&lt;\/servlet-name&gt;         &lt;url-pattern&gt;\/&lt;\/url-pattern&gt;     &lt;\/servlet-mapping&gt;     &lt;!--DispatcherServlet--&gt;      &lt;listener&gt;         &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;\/listener-class&gt;     &lt;\/listener&gt;      &lt;!--\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0440\u0435\u0441\u0443\u0440\u0441--&gt;     &lt;resource-ref&gt;         &lt;!--\u0422\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 --&gt;         &lt;description&gt;Datasource&lt;\/description&gt;         &lt;!-- \u043f\u0443\u0442\u044c \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0440\u0435\u0441\u0443\u0440\u0441--&gt;         &lt;res-ref-name&gt;jdbc\/Database&lt;\/res-ref-name&gt;         &lt;!-- \u0422\u0438\u043f \u0440\u0435\u0441\u0443\u0440\u0441\u0430--&gt;         &lt;res-type&gt;javax.sql.DataSource&lt;\/res-type&gt;         &lt;!-- \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0430 \u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f--&gt;         &lt;res-auth&gt;Container&lt;\/res-auth&gt;     &lt;\/resource-ref&gt;  &lt;\/web-app&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0430\u043c\u0443 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">jetty-context.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;!DOCTYPE Configure PUBLIC &quot;-\/\/Jetty\/\/Configure\/\/EN&quot; &quot;http:\/\/www.eclipse.org\/jetty\/configure_9_3.dtd&quot;&gt;  &lt;Configure id=&quot;ExampleServer&quot; class=&quot;org.eclipse.jetty.server.Server&quot;&gt;     &lt;New id=&quot;DS&quot; class=&quot;org.eclipse.jetty.plus.jndi.Resource&quot;&gt;         &lt;Arg&gt;             &lt;Ref refid=&quot;wac&quot;\/&gt;         &lt;\/Arg&gt;         &lt;Arg&gt;jdbc\/Database&lt;\/Arg&gt;         &lt;Arg&gt;             &lt;New class=&quot;org.hsqldb.jdbc.JDBCDataSource&quot;&gt;                 &lt;Set name=&quot;DatabaseName&quot;&gt;jdbc:hsqldb:hsql:\/\/localhost:9001\/xdb&lt;\/Set&gt;                 &lt;Set name=&quot;User&quot;&gt;SA&lt;\/Set&gt;                 &lt;Set name=&quot;Password&quot;&gt;password&lt;\/Set&gt;             &lt;\/New&gt;         &lt;\/Arg&gt;     &lt;\/New&gt; &lt;\/Configure&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 <a href=\"http:\/\/localhost:8080\/gull\/hello\">localhost:8080\/gull\/hello<\/a> \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u0432\u0445\u043e\u0434\u043e\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u0430\u0440\u043e\u043b\u044c. \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c (admin\/password) \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u044d\u0442\u0430\u043f\u0435. <br \/>  <a name=\"SpringSecurityCustom\"><\/a><\/p>\n<h4>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432\u0445\u043e\u0434\u0430<\/h4>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ad4\/1cc\/554\/ad41cc554e254df89b2b2301f8779cca\"\/><br \/>  \u0421\u0435\u0439\u0447\u0430\u0441 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0439\u0442\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0437 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0438 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u044d\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432\u0445\u043e\u0434\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432\u0445\u043e\u0434\u0430 \u043d\u0430 \u0441\u0432\u043e\u044e. <br \/>  \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432\u0445\u043e\u0434\u0430 \u0432 security.xml  <\/p>\n<pre><code class=\"xml\">        &lt;form-login login-page=&quot;\/login&quot; default-target-url=&quot;\/&quot;\/&gt; <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;beans:beans xmlns:beans=&quot;http:\/\/www.springframework.org\/schema\/beans&quot;              xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;              xmlns=&quot;http:\/\/www.springframework.org\/schema\/security&quot;              xsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans                  http:\/\/www.springframework.org\/schema\/beans\/spring-beans-4.0.xsd                  http:\/\/www.springframework.org\/schema\/security                   http:\/\/www.springframework.org\/schema\/security\/spring-security-4.0.xsd&quot;&gt;       &lt;http&gt;         &lt;intercept-url pattern=&quot;\/hello**&quot; access=&quot;hasRole('USER')&quot;\/&gt;          &lt;form-login login-page=&quot;\/login&quot; default-target-url=&quot;\/&quot;\/&gt;         &lt;logout logout-url=&quot;\/logout&quot; logout-success-url=&quot;\/&quot;\/&gt;         &lt;anonymous username=&quot;guest&quot; granted-authority=&quot;ANONYMOUS&quot;\/&gt;         &lt;http-basic\/&gt;         &lt;remember-me\/&gt;     &lt;\/http&gt;       &lt;authentication-manager&gt;         &lt;authentication-provider&gt;             &lt;password-encoder ref=&quot;encoder&quot;\/&gt;             &lt;jdbc-user-service data-source-ref=&quot;dbDataSource&quot;                                users-by-username-query=&quot;SELECT username, password, enabled FROM Users WHERE username= ?&quot;                                authorities-by-username-query=&quot;SELECT u1.username, u2.authority FROM Users u1, Authorities u2 WHERE u1.id = u2.userId AND u1.UserName = ?&quot;\/&gt;         &lt;\/authentication-provider&gt;     &lt;\/authentication-manager&gt;      &lt;beans:bean id=&quot;encoder&quot; class=&quot;org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder&quot;&gt;         &lt;beans:constructor-arg name=&quot;strength&quot; value=&quot;10&quot;\/&gt;     &lt;\/beans:bean&gt;  &lt;\/beans:beans&gt;   <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 view \u0432 dispatcher-servlet.xml  <\/p>\n<pre><code class=\"diff\">    &lt;mvc:view-controller path=&quot;\/login&quot; view-name=&quot;login&quot;\/&gt; <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;beans xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;        xmlns:mvc=&quot;http:\/\/www.springframework.org\/schema\/mvc&quot;        xmlns:context=&quot;http:\/\/www.springframework.org\/schema\/context&quot;        xmlns=&quot;http:\/\/www.springframework.org\/schema\/beans&quot;        xsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd            http:\/\/www.springframework.org\/schema\/mvc http:\/\/www.springframework.org\/schema\/mvc\/spring-mvc.xsd            http:\/\/www.springframework.org\/schema\/context http:\/\/www.springframework.org\/schema\/context\/spring-context.xsd&quot;&gt;      &lt;!-- \u0431\u0438\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0433\u0434\u0435 \u043b\u0435\u0436\u0430\u0442 jsp \u0434\u043b\u044f view --&gt;     &lt;bean class=&quot;org.springframework.web.servlet.view.InternalResourceViewResolver&quot;&gt;         &lt;property name=&quot;prefix&quot; value=&quot;\/WEB-INF\/jsp\/&quot;\/&gt;         &lt;property name=&quot;suffix&quot; value=&quot;.jsp&quot;\/&gt;     &lt;\/bean&gt;      &lt;mvc:view-controller path=&quot;\/&quot; view-name=&quot;index&quot;\/&gt;     &lt;mvc:view-controller path=&quot;\/login&quot; view-name=&quot;login&quot;\/&gt;       &lt;!--\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 mvc --&gt;     &lt;mvc:annotation-driven\/&gt;     &lt;!--\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 \u043a\u0430\u043a\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a --&gt;     &lt;context:component-scan base-package=&quot;com.intetm.web&quot;\/&gt;  &lt;\/beans&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432\u0445\u043e\u0434\u0430.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">login.jsp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;%@ page contentType=&quot;text\/html&quot; pageEncoding=&quot;UTF-8&quot; %&gt; &lt;%@ taglib prefix=&quot;form&quot; uri=&quot;http:\/\/www.springframework.org\/tags\/form&quot; %&gt; &lt;%@ taglib prefix=&quot;c&quot; uri=&quot;http:\/\/java.sun.com\/jsp\/jstl\/core&quot; %&gt; &lt;!--suppress HtmlFormInputWithoutLabel --&gt; &lt;html&gt; &lt;head&gt;     &lt;title&gt;Login Page&lt;\/title&gt; &lt;\/head&gt; &lt;body&gt; &lt;div align=&quot;center&quot;&gt;     &lt;h3&gt;Login with Username and Password&lt;\/h3&gt;      &lt;form:form id='formLogin' action='.\/login' method='POST'&gt;         &lt;table&gt;             &lt;tr&gt;                 &lt;td&gt;username:&lt;\/td&gt;                 &lt;td&gt;&lt;input type='text' name='username' value='' autofocus&gt;&lt;\/td&gt;             &lt;\/tr&gt;             &lt;tr&gt;                 &lt;td&gt;password:&lt;\/td&gt;                 &lt;td&gt;&lt;input type='password' name='password'\/&gt;&lt;\/td&gt;             &lt;\/tr&gt;             &lt;tr&gt;                 &lt;td&gt;&lt;input type='checkbox' name='remember-me'\/&gt;&lt;\/td&gt;                 &lt;td&gt;remember-me&lt;\/td&gt;             &lt;\/tr&gt;             &lt;tr&gt;                 &lt;td colspan='2'&gt;&lt;input name=&quot;submit&quot; type=&quot;submit&quot; value=&quot;submit&quot;\/&gt;&lt;\/td&gt;             &lt;\/tr&gt;         &lt;\/table&gt;     &lt;\/form:form&gt; &lt;\/div&gt; &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u043d\u0438\u0446\u0443 hello \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u0430.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">hello.jsp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;%--suppress ELValidationInJSP --%&gt; &lt;%@ page contentType=&quot;text\/html;charset=UTF-8&quot; language=&quot;java&quot; %&gt; &lt;%@ taglib prefix=&quot;c&quot; uri=&quot;http:\/\/java.sun.com\/jsp\/jstl\/core&quot; %&gt;  &lt;html&gt; &lt;head&gt;     &lt;title&gt;Title&lt;\/title&gt; &lt;\/head&gt; &lt;body&gt; &lt;!--suppress XmlPathReference --&gt; &lt;c:url value=&quot;\/logout&quot; var=&quot;logoutUrl&quot;\/&gt;  &lt;!-- csrt support --&gt; &lt;form action=&quot;${logoutUrl}&quot; method=&quot;post&quot; id=&quot;logoutForm&quot;&gt;     &lt;input type=&quot;hidden&quot;            name=&quot;${_csrf.parameterName}&quot;            value=&quot;${_csrf.token}&quot;\/&gt; &lt;\/form&gt;  &lt;script&gt;     function formSubmit() {         document.getElementById(&quot;logoutForm&quot;).submit();     } &lt;\/script&gt;  &lt;c:if test=&quot;${pageContext.request.userPrincipal.name != null}&quot;&gt;     &lt;h2&gt;         Welcome : ${pageContext.request.userPrincipal.name} | &lt;a             href=&quot;javascript:formSubmit()&quot;&gt; Logout&lt;\/a&gt;     &lt;\/h2&gt; &lt;\/c:if&gt;  Hello, ${subject}! &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0432 JSP, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 jstl<\/b><\/p>\n<div class=\"spoiler_text\">build.gradle  <\/p>\n<pre><code class=\"bash\">dependencies {     runtime group: 'org.apache.taglibs', name: 'taglibs-standard-impl', version: gradle.jstlVersion } <\/code><\/pre>\n<p>  settings.gradle  <\/p>\n<pre><code class=\"bash\">gradle.ext.jstlVersion = '1.2.5' <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c.<br \/>  <a name=\"Js\"><\/a><\/p>\n<h4>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 javascript<\/h4>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/0f4\/2c6\/735\/0f42c673590347deb55b4d1e35e8f456\"\/><br \/>  \u0411\u0435\u0437 JavaScript \u043d\u0435 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u043e\u0434\u0438\u043d \u0441\u0430\u0439\u0442. \u0418\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u0432\u0435\u0440\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0432\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u0434\u0430\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438 \u2018\u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u044b\u0445\u2019 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043d\u0430 \u043b\u0435\u0442\u0443. \u0410 \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0435 \u0431\u044b\u043b\u0430 \u0434\u043e\u043b\u0433\u043e\u0439, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u043e\u0431 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. <br \/>  \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e JavaScript \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u0434\u0432\u0430 \u044d\u0442\u0430\u043f\u0430. \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u043c \u0440\u0430\u0437\u0440\u043e\u0437\u043d\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0432 \u043e\u0434\u0438\u043d, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u043f\u043e\u0434\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u043b\u0438\u0448\u043d\u0438\u0435 \u2014 \u043f\u0440\u043e\u0431\u0435\u043b\u044b, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0435 \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0430 \u043e\u0442\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0442\u043a\u0443\u043f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443. \u042f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c Google Closure Compiler \u0432 \u043e\u0431\u0435\u0440\u0442\u043a\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043a Gradle. <br \/>  \u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435! \u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 gooqle. \u0421 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u043d\u0438 \u0443\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0432 \u043a\u0435\u0448\u0435 \u0438 \u0438\u0445 \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c. <br \/>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u043a gradle. <br \/>  build.gradle  <\/p>\n<pre><code class=\"bash\">plugins {     id &quot;com.eriwen.gradle.js&quot; version &quot;1.12.1&quot; } <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u043c \u043c\u0438\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<br \/>  login.js  <\/p>\n<pre><code class=\"javascript\">$(function () {     $(&quot;#tabs&quot;).tabs(); }); <\/code><\/pre>\n<p>  \u0412\u043d\u043e\u0441\u0438\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 login.jsp. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0431\u0443\u0434\u0443\u0449\u0438\u0439 \u043c\u0438\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 jquery \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 google.  <\/p>\n<pre><code class=\"html\"> &lt;script src=&quot;https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.11.3\/jquery.min.js&quot;&gt;&lt;\/script&gt;  &lt;script src=&quot;https:\/\/ajax.googleapis.com\/ajax\/libs\/jqueryui\/1.11.4\/jquery-ui.min.js&quot;&gt;&lt;\/script&gt;  &lt;link rel=&quot;stylesheet&quot; href=&quot;https:\/\/ajax.googleapis.com\/ajax\/libs\/jqueryui\/1.11.4\/themes\/smoothness\/jquery-ui.css&quot;&gt;  &lt;script src=&quot;js\/login.js&quot;&gt;&lt;\/script&gt; <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"html\">&lt;%@ page contentType=&quot;text\/html&quot; pageEncoding=&quot;UTF-8&quot; %&gt; &lt;%@ taglib prefix=&quot;form&quot; uri=&quot;http:\/\/www.springframework.org\/tags\/form&quot; %&gt; &lt;%@ taglib prefix=&quot;c&quot; uri=&quot;http:\/\/java.sun.com\/jsp\/jstl\/core&quot; %&gt; &lt;!--suppress HtmlFormInputWithoutLabel --&gt; &lt;html&gt; &lt;head&gt;     &lt;title&gt;Login Page&lt;\/title&gt;     &lt;script src=&quot;https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.11.3\/jquery.min.js&quot;&gt;&lt;\/script&gt;     &lt;script src=&quot;https:\/\/ajax.googleapis.com\/ajax\/libs\/jqueryui\/1.11.4\/jquery-ui.min.js&quot;&gt;&lt;\/script&gt;     &lt;link rel=&quot;stylesheet&quot; href=&quot;https:\/\/ajax.googleapis.com\/ajax\/libs\/jqueryui\/1.11.4\/themes\/smoothness\/jquery-ui.css&quot;&gt;     &lt;!--suppress HtmlUnknownTarget --&gt;     &lt;script src=&quot;js\/login.js&quot;&gt;&lt;\/script&gt; &lt;\/head&gt; &lt;body&gt; &lt;div align=&quot;center&quot;&gt;      &lt;div id=&quot;tabs&quot;&gt;         &lt;ul&gt;             &lt;li&gt;&lt;a href=&quot;#tabs-1&quot;&gt;Sign in&lt;\/a&gt;&lt;\/li&gt;             &lt;li&gt;&lt;a href=&quot;#tabs-2&quot;&gt;Create user&lt;\/a&gt;&lt;\/li&gt;         &lt;\/ul&gt;         &lt;div id=&quot;tabs-1&quot;&gt;             &lt;h3&gt;Login with Username and Password&lt;\/h3&gt;              &lt;form:form id='formLogin' action='.\/login' method='POST'&gt;                 &lt;table&gt;                     &lt;tr&gt;                         &lt;td&gt;username:&lt;\/td&gt;                         &lt;td&gt;&lt;input type='text' name='username' value='' autofocus&gt;&lt;\/td&gt;                     &lt;\/tr&gt;                     &lt;tr&gt;                         &lt;td&gt;password:&lt;\/td&gt;                         &lt;td&gt;&lt;input type='password' name='password'\/&gt;&lt;\/td&gt;                     &lt;\/tr&gt;                     &lt;tr&gt;                         &lt;td&gt;&lt;input type='checkbox' name='remember-me'\/&gt;&lt;\/td&gt;                         &lt;td&gt;remember-me&lt;\/td&gt;                     &lt;\/tr&gt;                     &lt;tr&gt;                         &lt;td colspan='2'&gt;&lt;input name=&quot;submit&quot; type=&quot;submit&quot; value=&quot;submit&quot;\/&gt;&lt;\/td&gt;                     &lt;\/tr&gt;                 &lt;\/table&gt;             &lt;\/form:form&gt;         &lt;\/div&gt;         &lt;div id=&quot;tabs-2&quot;&gt;             &lt;h3&gt;Create user&lt;\/h3&gt;              &lt;form:form id='formCreate' action='.\/createUser' method='POST'&gt;                 &lt;table&gt;                     &lt;tr&gt;                         &lt;td&gt;username:&lt;\/td&gt;                         &lt;td&gt;&lt;input type='text' name='username' value=''&gt;&lt;\/td&gt;                     &lt;\/tr&gt;                     &lt;tr&gt;                         &lt;td&gt;password:&lt;\/td&gt;                         &lt;td&gt;&lt;input type='password' name='password'\/&gt;&lt;\/td&gt;                     &lt;\/tr&gt;                     &lt;tr&gt;                         &lt;td colspan='2'&gt;&lt;input name=&quot;submit&quot; type=&quot;submit&quot; value=&quot;submit&quot;\/&gt;&lt;\/td&gt;                     &lt;\/tr&gt;                 &lt;\/table&gt;             &lt;\/form:form&gt;         &lt;\/div&gt;      &lt;\/div&gt; &lt;\/div&gt; &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 dispatcher-servlet.xml \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b.   <\/p>\n<pre><code class=\"xml\">    &lt;mvc:resources mapping=&quot;\/js\/**&quot; location=&quot;\/js\/&quot;\/&gt; <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;beans xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;        xmlns:mvc=&quot;http:\/\/www.springframework.org\/schema\/mvc&quot;        xmlns:context=&quot;http:\/\/www.springframework.org\/schema\/context&quot;        xmlns=&quot;http:\/\/www.springframework.org\/schema\/beans&quot;        xsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd            http:\/\/www.springframework.org\/schema\/mvc http:\/\/www.springframework.org\/schema\/mvc\/spring-mvc.xsd            http:\/\/www.springframework.org\/schema\/context http:\/\/www.springframework.org\/schema\/context\/spring-context.xsd&quot;&gt;      &lt;!-- \u0431\u0438\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0433\u0434\u0435 \u043b\u0435\u0436\u0430\u0442 jsp \u0434\u043b\u044f view --&gt;     &lt;bean class=&quot;org.springframework.web.servlet.view.InternalResourceViewResolver&quot;&gt;         &lt;property name=&quot;prefix&quot; value=&quot;\/WEB-INF\/jsp\/&quot;\/&gt;         &lt;property name=&quot;suffix&quot; value=&quot;.jsp&quot;\/&gt;     &lt;\/bean&gt;      &lt;mvc:view-controller path=&quot;\/&quot; view-name=&quot;index&quot;\/&gt;     &lt;mvc:view-controller path=&quot;\/login&quot; view-name=&quot;login&quot;\/&gt;      &lt;mvc:resources mapping=&quot;\/js\/**&quot; location=&quot;\/js\/&quot;\/&gt;      &lt;!--\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 mvc --&gt;     &lt;mvc:annotation-driven\/&gt;     &lt;!--\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 \u043a\u0430\u043a\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a --&gt;     &lt;context:component-scan base-package=&quot;com.intetm.web&quot;\/&gt;  &lt;\/beans&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 build.gradle \u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0431\u0435\u0440\u0443\u0442 \u0438 \u043c\u0438\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0442 javascript \u0444\u0430\u0439\u043b\u044b. Google Closure Compiler \u0438 \u0434\u0430\u0436\u0435 \u0443\u043c\u0435\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c sourcemap, \u0447\u0442\u043e \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043c\u0438\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043d\u043e\u0441\u044f\u0442 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0442\u043e \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u0435\u0442 \u043e\u0442\u043b\u0430\u0434\u043a\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u043c \u043f\u0440\u043e\u0449\u0435 \u2014 \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0431\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u0431\u0435\u0437 \u043c\u0438\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u0435\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u0443\u044e \u0441\u0431\u043e\u0440\u043a\u0443.   <\/p>\n<pre><code class=\"bash\">javascript.source {     login {         js {             srcDir &quot;src\/main\/js\/login&quot;             include &quot;*.js&quot;         }     } } combineJs {     source = javascript.source.login.js.files     \/\/noinspection GrReassignedInClosureLocalVar     dest = file(&quot;${buildDir}\/js\/combine\/login.js&quot;) }  minifyJs {     source = combineJs     \/\/noinspection GrReassignedInClosureLocalVar     dest = file(&quot;${buildDir}\/js\/min\/login.js&quot;)     \/\/sourceMap = file(&quot;${buildDir}\/js\/min\/login.sourcemap.json&quot;)     closure {         warningLevel = 'QUIET'     } }  def dev = true; task copyJs(type: Copy) {     group = 'develop'     from(dev ? combineJs : minifyJs) as String     into &quot;src\/main\/webapp\/js&quot; } compileJava.dependsOn.add(copyJs) <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">buildscript {     repositories {         mavenLocal()         mavenCentral()         jcenter()     }     dependencies {         classpath group: 'org.hsqldb', name: 'hsqldb', version: gradle.hsqldbVersion     } }  plugins {     id &quot;org.akhikhl.gretty&quot; version &quot;1.2.4&quot;     id 'org.liquibase.gradle' version '1.1.1'     id &quot;com.eriwen.gradle.js&quot; version &quot;1.12.1&quot; }  group 'com.intetm' version '0.1'  apply plugin: 'java' apply plugin: 'war' apply from: 'database.gradle'  \/\/noinspection GroovyUnusedAssignment sourceCompatibility = 1.8  repositories {     mavenCentral() }  dependencies {     runtime group: 'org.springframework', name: 'spring-jdbc', version: gradle.springVersion     compile group: 'org.springframework', name: 'spring-webmvc', version: gradle.springVersion      runtime group: 'org.springframework.security', name: 'spring-security-web', version: gradle.springSecurityVersion     runtime group: 'org.springframework.security', name: 'spring-security-config', version: gradle.springSecurityVersion      compile group: 'org.slf4j', name: 'slf4j-api', version: gradle.slf4jVersion     runtime group: 'ch.qos.logback', name: 'logback-classic', version: gradle.logbackVersion      runtime group: 'org.apache.taglibs', name: 'taglibs-standard-impl', version: gradle.jstlVersion      gretty group: 'org.hsqldb', name: 'hsqldb', version: gradle.hsqldbVersion }  def serverHttpPort = project.properties['serverHttpPort'] ?: gradle.serverHttpPort def serverResourcesPath = project.properties['serverResourcesPath'] ?: gradle.serverResourcesPath def serverContextFile = project.properties['serverContextFile'] ?: gradle.serverContextFile def serverClassPath = [project.properties['serverClassPath'] ?: gradle.serverClassPath] as Set def dbUser = project.properties['dbUser'] ?: gradle.dbUser def dbPassword = project.properties['dbPassword'] ?: gradle.dbPassword def dbUrl = project.properties['dbUrl'] ?: gradle.dbUrl  gretty {     httpPort = serverHttpPort     serverConfigFile = serverContextFile     classPath = serverClassPath     inplaceMode = &quot;hard&quot; }  task copyEnvironment(type: Copy) {     group = 'develop'     from 'src\/test\/resources\/environment'     into serverResourcesPath }  liquibase {     activities {         \/\/noinspection GroovyAssignabilityCheck         main {             changeLogFile 'src\/sql\/main\/changelog.xml'             url dbUrl             username dbUser             password dbPassword         }         dev {             changeLogFile 'src\/sql\/dev\/changelog.xml'             url dbUrl             username dbUser             password dbPassword         }     } } task updateDbMain(dependsOn: startDatabase) {     group = 'develop'     doLast {         liquibase.runList = 'main'         tasks.update.execute()     } }  task updateDbDev(dependsOn: startDatabase) {     group = 'develop'     doLast {         liquibase.runList = 'main, dev'         tasks.update.execute()     } }  javascript.source {     login {         js {             srcDir &quot;src\/main\/js\/login&quot;             include &quot;*.js&quot;         }     } } combineJs {     source = javascript.source.login.js.files     \/\/noinspection GrReassignedInClosureLocalVar     dest = file(&quot;${buildDir}\/js\/combine\/login.js&quot;) }  minifyJs {     source = combineJs     \/\/noinspection GrReassignedInClosureLocalVar     dest = file(&quot;${buildDir}\/js\/min\/login.js&quot;)     \/\/sourceMap = file(&quot;${buildDir}\/js\/min\/login.sourcemap.json&quot;)     closure {         warningLevel = 'QUIET'     } }  def dev = true; task copyJs(type: Copy) {     group = 'develop'     from(dev ? combineJs : minifyJs) as String     into &quot;src\/main\/webapp\/js&quot; } compileJava.dependsOn.add(copyJs) <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 copyJs, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0435\u0436\u0438\u043c\u0430 \u0441\u0436\u0430\u0442\u0443\u044e \u0438\u043b\u0438 \u043d\u0435 \u0441\u0436\u0430\u0442\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043d\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 Java \u0444\u0430\u0439\u043b\u043e\u0432, \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. <br \/>  <a name=\"Css\"><\/a><\/p>\n<h4>\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 css<\/h4>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/114\/e3f\/bbb\/114e3fbbb2c74705bcbf2f289bd8cb40\"\/><br \/>  \u0420\u0430\u0431\u043e\u0442\u0430 \u0441 CSS \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f, \u043e\u0442 JavaScript. \u0424\u0430\u0439\u043b\u044b \u0442\u0430\u043a \u0436\u0435 \u0441\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0434\u0438\u043d \u0441\u0436\u0438\u043c\u0430\u0435\u0442\u0441\u044f. \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f, \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u043a\u0432\u0430\u043c\u0438 CSS \u0432\u043c\u0435\u0441\u0442\u043e JavaScript. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432 build.gradle.  <\/p>\n<pre><code class=\"bash\">plugins {     id &quot;com.eriwen.gradle.css&quot; version &quot;1.11.1&quot; }  css.source {     login {         css {             srcDir &quot;src\/main\/css\/login&quot;             include &quot;*.css&quot;         }     } }  combineCss {     source = css.source.login.css.files     \/\/noinspection GrReassignedInClosureLocalVar     dest = file(&quot;${buildDir}\/css\/combine\/login.css&quot;) }  minifyCss {     source = combineCss     dest = file(&quot;${buildDir}\/css\/min\/login.css&quot;)     yuicompressor { \/\/ Optional         lineBreakPos = -1     } } task copyCss(type: Copy) {     group = 'develop'     from(dev ? combineCss : minifyCss) as String     into &quot;src\/main\/webapp\/css&quot; }  compileJava.dependsOn.add(copyCss) <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">buildscript {     repositories {         mavenLocal()         mavenCentral()         jcenter()     }     dependencies {         classpath group: 'org.hsqldb', name: 'hsqldb', version: gradle.hsqldbVersion     } }  plugins {     id &quot;org.akhikhl.gretty&quot; version &quot;1.2.4&quot;     id 'org.liquibase.gradle' version '1.1.1'     id &quot;com.eriwen.gradle.js&quot; version &quot;1.12.1&quot;     id &quot;com.eriwen.gradle.css&quot; version &quot;1.11.1&quot; }  group 'com.intetm' version '0.1'  apply plugin: 'java' apply plugin: 'war' apply from: 'database.gradle'  \/\/noinspection GroovyUnusedAssignment sourceCompatibility = 1.8  repositories {     mavenCentral() }  dependencies {     runtime group: 'org.springframework', name: 'spring-jdbc', version: gradle.springVersion     compile group: 'org.springframework', name: 'spring-webmvc', version: gradle.springVersion      runtime group: 'org.springframework.security', name: 'spring-security-web', version: gradle.springSecurityVersion     runtime group: 'org.springframework.security', name: 'spring-security-config', version: gradle.springSecurityVersion      compile group: 'org.slf4j', name: 'slf4j-api', version: gradle.slf4jVersion     runtime group: 'ch.qos.logback', name: 'logback-classic', version: gradle.logbackVersion      runtime group: 'org.apache.taglibs', name: 'taglibs-standard-impl', version: gradle.jstlVersion      gretty group: 'org.hsqldb', name: 'hsqldb', version: gradle.hsqldbVersion }  def serverHttpPort = project.properties['serverHttpPort'] ?: gradle.serverHttpPort def serverResourcesPath = project.properties['serverResourcesPath'] ?: gradle.serverResourcesPath def serverContextFile = project.properties['serverContextFile'] ?: gradle.serverContextFile def serverClassPath = [project.properties['serverClassPath'] ?: gradle.serverClassPath] as Set def dbUser = project.properties['dbUser'] ?: gradle.dbUser def dbPassword = project.properties['dbPassword'] ?: gradle.dbPassword def dbUrl = project.properties['dbUrl'] ?: gradle.dbUrl  gretty {     httpPort = serverHttpPort     serverConfigFile = serverContextFile     classPath = serverClassPath     inplaceMode = &quot;hard&quot; }  task copyEnvironment(type: Copy) {     group = 'develop'     from 'src\/test\/resources\/environment'     into serverResourcesPath }  liquibase {     activities {         \/\/noinspection GroovyAssignabilityCheck         main {             changeLogFile 'src\/sql\/main\/changelog.xml'             url dbUrl             username dbUser             password dbPassword         }         dev {             changeLogFile 'src\/sql\/dev\/changelog.xml'             url dbUrl             username dbUser             password dbPassword         }     } } task updateDbMain(dependsOn: startDatabase) {     group = 'develop'     doLast {         liquibase.runList = 'main'         tasks.update.execute()     } }  task updateDbDev(dependsOn: startDatabase) {     group = 'develop'     doLast {         liquibase.runList = 'main, dev'         tasks.update.execute()     } }  javascript.source {     login {         js {             srcDir &quot;src\/main\/js\/login&quot;             include &quot;*.js&quot;         }     } }  combineJs {     source = javascript.source.login.js.files     \/\/noinspection GrReassignedInClosureLocalVar     dest = file(&quot;${buildDir}\/js\/combine\/login.js&quot;) }  minifyJs {     source = combineJs     \/\/noinspection GrReassignedInClosureLocalVar     dest = file(&quot;${buildDir}\/js\/min\/login.js&quot;)     \/\/sourceMap = file(&quot;${buildDir}\/js\/min\/login.sourcemap.json&quot;)     closure {         warningLevel = 'QUIET'     } }  css.source {     login {         css {             srcDir &quot;src\/main\/css\/login&quot;             include &quot;*.css&quot;         }     } }  combineCss {     source = css.source.login.css.files     \/\/noinspection GrReassignedInClosureLocalVar     dest = file(&quot;${buildDir}\/css\/combine\/login.css&quot;) }  minifyCss {     source = combineCss     dest = file(&quot;${buildDir}\/css\/min\/login.css&quot;)     yuicompressor { \/\/ Optional         lineBreakPos = -1     } }  def dev = true; task copyJs(type: Copy) {     group = 'develop'     from(dev ? combineJs : minifyJs) as String     into &quot;src\/main\/webapp\/js&quot; } task copyCss(type: Copy) {     group = 'develop'     from(dev ? combineCss : minifyCss) as String     into &quot;src\/main\/webapp\/css&quot; }  compileJava.dependsOn.add(copyJs) compileJava.dependsOn.add(copyCss) <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c login.css   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">login.css<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"css\">.tab-centered {     width: 500px; }  .tab-centered .ui-tabs-nav {     height: 2.35em;     text-align: center; }  .tab-centered .ui-tabs-nav li {     display: inline-block;     float: none;     margin: 0; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c CSS \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443.  <\/p>\n<pre><code class=\"html\">&lt;link rel=&quot;stylesheet&quot; href=&quot;css\/login.css&quot;&gt; ...  &lt;div id=&quot;tabs&quot; class=&quot;tab-centered&quot;&gt; <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;%@ page contentType=&quot;text\/html&quot; pageEncoding=&quot;UTF-8&quot; %&gt; &lt;%@ taglib prefix=&quot;form&quot; uri=&quot;http:\/\/www.springframework.org\/tags\/form&quot; %&gt; &lt;%@ taglib prefix=&quot;c&quot; uri=&quot;http:\/\/java.sun.com\/jsp\/jstl\/core&quot; %&gt; &lt;!--suppress HtmlFormInputWithoutLabel --&gt; &lt;html&gt; &lt;head&gt;     &lt;title&gt;Login Page&lt;\/title&gt;     &lt;script src=&quot;https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.11.3\/jquery.min.js&quot;&gt;&lt;\/script&gt;     &lt;script src=&quot;https:\/\/ajax.googleapis.com\/ajax\/libs\/jqueryui\/1.11.4\/jquery-ui.min.js&quot;&gt;&lt;\/script&gt;     &lt;link rel=&quot;stylesheet&quot; href=&quot;https:\/\/ajax.googleapis.com\/ajax\/libs\/jqueryui\/1.11.4\/themes\/smoothness\/jquery-ui.css&quot;&gt;     &lt;!--suppress HtmlUnknownTarget --&gt;     &lt;script src=&quot;js\/login.js&quot;&gt;&lt;\/script&gt;     &lt;!--suppress HtmlUnknownTarget --&gt;     &lt;link rel=&quot;stylesheet&quot; href=&quot;css\/login.css&quot;&gt;  &lt;\/head&gt; &lt;body&gt; &lt;div align=&quot;center&quot;&gt;      &lt;div id=&quot;tabs&quot; class=&quot;tab-centered&quot;&gt;         &lt;ul&gt;             &lt;li&gt;&lt;a href=&quot;#tabs-1&quot;&gt;Sign in&lt;\/a&gt;&lt;\/li&gt;             &lt;li&gt;&lt;a href=&quot;#tabs-2&quot;&gt;Create user&lt;\/a&gt;&lt;\/li&gt;         &lt;\/ul&gt;         &lt;div id=&quot;tabs-1&quot;&gt;             &lt;h3&gt;Login with Username and Password&lt;\/h3&gt;              &lt;form:form id='formLogin' action='.\/login' method='POST'&gt;                 &lt;table&gt;                     &lt;tr&gt;                         &lt;td&gt;username:&lt;\/td&gt;                         &lt;td&gt;&lt;input type='text' name='username' value='' autofocus&gt;&lt;\/td&gt;                     &lt;\/tr&gt;                     &lt;tr&gt;                         &lt;td&gt;password:&lt;\/td&gt;                         &lt;td&gt;&lt;input type='password' name='password'\/&gt;&lt;\/td&gt;                     &lt;\/tr&gt;                     &lt;tr&gt;                         &lt;td&gt;&lt;input type='checkbox' name='remember-me'\/&gt;&lt;\/td&gt;                         &lt;td&gt;remember-me&lt;\/td&gt;                     &lt;\/tr&gt;                     &lt;tr&gt;                         &lt;td colspan='2'&gt;&lt;input name=&quot;submit&quot; type=&quot;submit&quot; value=&quot;submit&quot;\/&gt;&lt;\/td&gt;                     &lt;\/tr&gt;                 &lt;\/table&gt;             &lt;\/form:form&gt;         &lt;\/div&gt;         &lt;div id=&quot;tabs-2&quot;&gt;             &lt;h3&gt;Create user&lt;\/h3&gt;              &lt;form:form id='formCreate' action='.\/createUser' method='POST'&gt;                 &lt;table&gt;                     &lt;tr&gt;                         &lt;td&gt;username:&lt;\/td&gt;                         &lt;td&gt;&lt;input type='text' name='username' value=''&gt;&lt;\/td&gt;                     &lt;\/tr&gt;                     &lt;tr&gt;                         &lt;td&gt;password:&lt;\/td&gt;                         &lt;td&gt;&lt;input type='password' name='password'\/&gt;&lt;\/td&gt;                     &lt;\/tr&gt;                     &lt;tr&gt;                         &lt;td colspan='2'&gt;&lt;input name=&quot;submit&quot; type=&quot;submit&quot; value=&quot;submit&quot;\/&gt;&lt;\/td&gt;                     &lt;\/tr&gt;                 &lt;\/table&gt;             &lt;\/form:form&gt;         &lt;\/div&gt;      &lt;\/div&gt; &lt;\/div&gt; &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c spring-mvc \u043e\u0442\u043a\u0443\u0434\u0430 \u0431\u0440\u0430\u0442\u044c css \u0444\u0430\u0439\u043b\u044b.  <\/p>\n<pre><code class=\"xml\">    &lt;mvc:resources mapping=&quot;\/css\/**&quot; location=&quot;\/css\/&quot;\/&gt; <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">dispatcher-servlet.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;beans xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;        xmlns:mvc=&quot;http:\/\/www.springframework.org\/schema\/mvc&quot;        xmlns:context=&quot;http:\/\/www.springframework.org\/schema\/context&quot;        xmlns=&quot;http:\/\/www.springframework.org\/schema\/beans&quot;        xsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd            http:\/\/www.springframework.org\/schema\/mvc http:\/\/www.springframework.org\/schema\/mvc\/spring-mvc.xsd            http:\/\/www.springframework.org\/schema\/context http:\/\/www.springframework.org\/schema\/context\/spring-context.xsd&quot;&gt;      &lt;!-- \u0431\u0438\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0433\u0434\u0435 \u043b\u0435\u0436\u0430\u0442 jsp \u0434\u043b\u044f view --&gt;     &lt;bean class=&quot;org.springframework.web.servlet.view.InternalResourceViewResolver&quot;&gt;         &lt;property name=&quot;prefix&quot; value=&quot;\/WEB-INF\/jsp\/&quot;\/&gt;         &lt;property name=&quot;suffix&quot; value=&quot;.jsp&quot;\/&gt;     &lt;\/bean&gt;      &lt;mvc:view-controller path=&quot;\/&quot; view-name=&quot;index&quot;\/&gt;     &lt;mvc:view-controller path=&quot;\/login&quot; view-name=&quot;login&quot;\/&gt;      &lt;mvc:resources mapping=&quot;\/js\/**&quot; location=&quot;\/js\/&quot;\/&gt;     &lt;mvc:resources mapping=&quot;\/css\/**&quot; location=&quot;\/css\/&quot;\/&gt;       &lt;!--\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 mvc --&gt;     &lt;mvc:annotation-driven\/&gt;     &lt;!--\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 \u043a\u0430\u043a\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a --&gt;     &lt;context:component-scan base-package=&quot;com.intetm.web&quot;\/&gt;  &lt;\/beans&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438 Java \u0438 JavaScript \u0438 CSS \u0444\u0430\u0439\u043b\u044b. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 <a href=\"http:\/\/localhost:8080\/gull\/login\">localhost:8080\/gull\/login<\/a><br \/>  <a name=\"Hibernate\"><\/a>ORM<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/976\/5c3\/b3a\/9765c3b3a9de429785ee50965b3264a7\"\/><br \/>  \u041f\u0435\u0440\u0435\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c rest \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0443 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0432\u0438\u0434\u0435 ORM. \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 ORM, \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0449\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 JPA, \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0439 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 javaee-api. \u041a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f (hibernate) \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430. <br \/>  build.gradle   <\/p>\n<pre><code class=\"bash\">    compile group: 'javax', name: 'javaee-api', version: gradle.javaxVersion      compile group: 'org.springframework', name: 'spring-orm', version: gradle.springVersion     compile group: 'org.springframework', name: 'spring-tx', version: gradle.springVersion      runtime group: 'org.hibernate.javax.persistence', name: 'hibernate-jpa-2.1-api', version: gradle.hibernateJpaVersion     runtime group: 'org.hibernate', name: 'hibernate-core', version: gradle.hibernateVersion     runtime group: 'org.hibernate', name: 'hibernate-entitymanager', version: gradle.hibernateVersion <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">buildscript {     repositories {         mavenLocal()         mavenCentral()         jcenter()     }     dependencies {         classpath group: 'org.hsqldb', name: 'hsqldb', version: gradle.hsqldbVersion     } }  plugins {     id &quot;org.akhikhl.gretty&quot; version &quot;1.2.4&quot;     id 'org.liquibase.gradle' version '1.1.1'     id &quot;com.eriwen.gradle.js&quot; version &quot;1.12.1&quot;     id &quot;com.eriwen.gradle.css&quot; version &quot;1.11.1&quot; }  group 'com.intetm' version '0.1'  apply plugin: 'java' apply plugin: 'war' apply from: 'database.gradle'  \/\/noinspection GroovyUnusedAssignment sourceCompatibility = 1.8  repositories {     mavenCentral() }  dependencies {     compile group: 'javax', name: 'javaee-api', version: gradle.javaxVersion      runtime group: 'org.springframework', name: 'spring-jdbc', version: gradle.springVersion     compile group: 'org.springframework', name: 'spring-webmvc', version: gradle.springVersion     compile group: 'org.springframework', name: 'spring-orm', version: gradle.springVersion     compile group: 'org.springframework', name: 'spring-tx', version: gradle.springVersion      runtime group: 'org.springframework.security', name: 'spring-security-web', version: gradle.springSecurityVersion     runtime group: 'org.springframework.security', name: 'spring-security-config', version: gradle.springSecurityVersion      runtime group: 'org.hibernate.javax.persistence', name: 'hibernate-jpa-2.1-api', version: gradle.hibernateJpaVersion     runtime group: 'org.hibernate', name: 'hibernate-core', version: gradle.hibernateVersion     runtime group: 'org.hibernate', name: 'hibernate-entitymanager', version: gradle.hibernateVersion      compile group: 'org.slf4j', name: 'slf4j-api', version: gradle.slf4jVersion     runtime group: 'ch.qos.logback', name: 'logback-classic', version: gradle.logbackVersion      runtime group: 'org.apache.taglibs', name: 'taglibs-standard-impl', version: gradle.jstlVersion      gretty group: 'org.hsqldb', name: 'hsqldb', version: gradle.hsqldbVersion }  def serverHttpPort = project.properties['serverHttpPort'] ?: gradle.serverHttpPort def serverResourcesPath = project.properties['serverResourcesPath'] ?: gradle.serverResourcesPath def serverContextFile = project.properties['serverContextFile'] ?: gradle.serverContextFile def serverClassPath = [project.properties['serverClassPath'] ?: gradle.serverClassPath] as Set def dbUser = project.properties['dbUser'] ?: gradle.dbUser def dbPassword = project.properties['dbPassword'] ?: gradle.dbPassword def dbUrl = project.properties['dbUrl'] ?: gradle.dbUrl  gretty {     httpPort = serverHttpPort     serverConfigFile = serverContextFile     classPath = serverClassPath     inplaceMode = &quot;hard&quot; }  task copyEnvironment(type: Copy) {     group = 'develop'     from 'src\/test\/resources\/environment'     into serverResourcesPath }  liquibase {     activities {         \/\/noinspection GroovyAssignabilityCheck         main {             changeLogFile 'src\/sql\/main\/changelog.xml'             url dbUrl             username dbUser             password dbPassword         }         dev {             changeLogFile 'src\/sql\/dev\/changelog.xml'             url dbUrl             username dbUser             password dbPassword         }     } } task updateDbMain(dependsOn: startDatabase) {     group = 'develop'     doLast {         liquibase.runList = 'main'         tasks.update.execute()     } }  task updateDbDev(dependsOn: startDatabase) {     group = 'develop'     doLast {         liquibase.runList = 'main, dev'         tasks.update.execute()     } }  javascript.source {     login {         js {             srcDir &quot;src\/main\/js\/login&quot;             include &quot;*.js&quot;         }     } }  combineJs {     source = javascript.source.login.js.files     \/\/noinspection GrReassignedInClosureLocalVar     dest = file(&quot;${buildDir}\/js\/combine\/login.js&quot;) }  minifyJs {     source = combineJs     \/\/noinspection GrReassignedInClosureLocalVar     dest = file(&quot;${buildDir}\/js\/min\/login.js&quot;)     \/\/sourceMap = file(&quot;${buildDir}\/js\/min\/login.sourcemap.json&quot;)     closure {         warningLevel = 'QUIET'     } }  css.source {     login {         css {             srcDir &quot;src\/main\/css\/login&quot;             include &quot;*.css&quot;         }     } }  combineCss {     source = css.source.login.css.files     \/\/noinspection GrReassignedInClosureLocalVar     dest = file(&quot;${buildDir}\/css\/combine\/login.css&quot;) }  minifyCss {     source = combineCss     dest = file(&quot;${buildDir}\/css\/min\/login.css&quot;)     yuicompressor { \/\/ Optional         lineBreakPos = -1     } }  def dev = true; task copyJs(type: Copy) {     group = 'develop'     from(dev ? combineJs : minifyJs) as String     into &quot;src\/main\/webapp\/js&quot; } task copyCss(type: Copy) {     group = 'develop'     from(dev ? combineCss : minifyCss) as String     into &quot;src\/main\/webapp\/css&quot; }  compileJava.dependsOn.add(copyJs) compileJava.dependsOn.add(copyCss) <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>   settings.gradle.  <\/p>\n<pre><code class=\"bash\">gradle.ext.javaxVersion = '7.0' gradle.ext.hibernateVersion = '5.0.2.Final' gradle.ext.hibernateJpaVersion = '1.0.0.Final' <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">rootProject.name = 'gull' \/\/lib version gradle.ext.springVersion = '4.2.2.RELEASE' gradle.ext.springSecurityVersion = '4.0.2.RELEASE' gradle.ext.javaxVersion = '7.0' gradle.ext.hibernateVersion = '5.0.2.Final' gradle.ext.hibernateJpaVersion = '1.0.0.Final' gradle.ext.slf4jVersion = '1.7.13' gradle.ext.logbackVersion = '1.1.3' gradle.ext.hsqldbVersion = '2.3.2' gradle.ext.jstlVersion = '1.2.5' \/\/default server config gradle.ext.serverHttpPort = 8080 gradle.ext.serverResourcesPath = &quot;dev\/resources&quot; gradle.ext.serverContextFile = &quot;src\/test\/resources\/environment\/jetty-context.xml&quot; gradle.ext.serverClassPath = &quot;src\/test\/resources\/environment\/classpath&quot; \/\/default database config gradle.ext.dbName = &quot;xdb&quot; gradle.ext.dbFile = &quot;dev\/database\/devDB&quot; gradle.ext.dbUser = &quot;SA&quot; gradle.ext.dbPassword = &quot;password&quot; gradle.ext.dbPort = 9001 gradle.ext.dbHost = &quot;localhost&quot; gradle.ext.dbUrl = &quot;jdbc:hsqldb:hsql:\/\/${gradle.dbHost}:${gradle.dbPort}\/${gradle.dbName}&quot; gradle.ext.dbDrive = &quot;org.hsqldb.jdbc.JDBCDriver&quot; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b JPA \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0432\u0430 \u0431\u0438\u043d\u0430.  <\/p>\n<ul>\n<li>EntityManagerFactory \u2014 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0431\u0438\u043d, \u0441\u043b\u0443\u0436\u0438\u0442 \u043c\u043e\u0441\u0442\u0438\u043a\u043e\u043c \u043c\u0435\u0436\u0434\u0443 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, ORM \u0438 \u043a\u043e\u0434\u043e\u043c.<\/li>\n<li>TransactionManager \u2014 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f\u043c\u0438.<\/li>\n<\/ul>\n<p>  dbContext.xml  <\/p>\n<pre><code class=\"xml\">&lt;bean id=&quot;entityManagerFactory&quot; class=&quot;org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean&quot;&gt;         &lt;property name=&quot;persistenceXmlLocation&quot; value=&quot;classpath:persistence.xml&quot;\/&gt;         &lt;property name=&quot;persistenceUnitName&quot; value=&quot;defaultUnit&quot;\/&gt;         &lt;property name=&quot;dataSource&quot; ref=&quot;dbDataSource&quot;\/&gt;         &lt;property name=&quot;jpaVendorAdapter&quot; ref=&quot;jpaVendorAdapter&quot;\/&gt;         &lt;property name=&quot;jpaDialect&quot; ref=&quot;jpaDialect&quot;\/&gt;     &lt;\/bean&gt;      &lt;bean id=&quot;jpaVendorAdapter&quot; class=&quot;org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter&quot;\/&gt;     &lt;bean id=&quot;jpaDialect&quot; class=&quot;org.springframework.orm.jpa.vendor.HibernateJpaDialect&quot;\/&gt;       &lt;bean id=&quot;transactionManager&quot; class=&quot;org.springframework.orm.jpa.JpaTransactionManager&quot;&gt;         &lt;property name=&quot;entityManagerFactory&quot; ref=&quot;entityManagerFactory&quot;\/&gt;     &lt;\/bean&gt;      &lt;context:component-scan base-package=&quot;com.intetm.db.dao&quot;\/&gt; <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;beans xmlns:jee=&quot;http:\/\/www.springframework.org\/schema\/jee&quot;        xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;        xmlns:context=&quot;http:\/\/www.springframework.org\/schema\/context&quot;        xmlns=&quot;http:\/\/www.springframework.org\/schema\/beans&quot;        xsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd                            http:\/\/www.springframework.org\/schema\/jee http:\/\/www.springframework.org\/schema\/jee\/spring-jee.xsd                            http:\/\/www.springframework.org\/schema\/context http:\/\/www.springframework.org\/schema\/context\/spring-context.xsd&quot;&gt;     &lt;jee:jndi-lookup id=&quot;dbDataSource&quot;                      jndi-name=&quot;jdbc\/Database&quot;                      expected-type=&quot;javax.sql.DataSource&quot;\/&gt;      &lt;bean id=&quot;entityManagerFactory&quot; class=&quot;org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean&quot;&gt;         &lt;property name=&quot;persistenceXmlLocation&quot; value=&quot;classpath:persistence.xml&quot;\/&gt;         &lt;property name=&quot;persistenceUnitName&quot; value=&quot;defaultUnit&quot;\/&gt;         &lt;property name=&quot;dataSource&quot; ref=&quot;dbDataSource&quot;\/&gt;         &lt;property name=&quot;jpaVendorAdapter&quot; ref=&quot;jpaVendorAdapter&quot;\/&gt;         &lt;property name=&quot;jpaDialect&quot; ref=&quot;jpaDialect&quot;\/&gt;     &lt;\/bean&gt;      &lt;bean id=&quot;jpaVendorAdapter&quot; class=&quot;org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter&quot;\/&gt;     &lt;bean id=&quot;jpaDialect&quot; class=&quot;org.springframework.orm.jpa.vendor.HibernateJpaDialect&quot;\/&gt;       &lt;bean id=&quot;transactionManager&quot; class=&quot;org.springframework.orm.jpa.JpaTransactionManager&quot;&gt;         &lt;property name=&quot;entityManagerFactory&quot; ref=&quot;entityManagerFactory&quot;\/&gt;     &lt;\/bean&gt;      &lt;context:component-scan base-package=&quot;com.intetm.db.dao&quot;\/&gt;  &lt;\/beans&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0423\u0436\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f hibernate, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u2014 persistence.xml. \u041e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u0438\u043f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0435. \u0412\u044b\u043d\u043e\u0441\u0438\u043c \u0444\u0430\u0439\u043b \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432 classPath \u0441\u0435\u0440\u0432\u0435\u0440\u0430.   <\/p>\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;persistence xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;              xmlns=&quot;http:\/\/xmlns.jcp.org\/xml\/ns\/persistence&quot;              xsi:schemaLocation=&quot;http:\/\/xmlns.jcp.org\/xml\/ns\/persistence http:\/\/xmlns.jcp.org\/xml\/ns\/persistence\/persistence.xsd&quot;              version=&quot;2.1&quot;&gt;     &lt;persistence-unit name=&quot;defaultUnit&quot; transaction-type=&quot;RESOURCE_LOCAL&quot;&gt;         &lt;provider&gt;org.hibernate.jpa.HibernatePersistenceProvider&lt;\/provider&gt;         &lt;jta-data-source&gt;jdbc\/Database&lt;\/jta-data-source&gt;         &lt;class&gt;com.intetm.db.entity.User&lt;\/class&gt;          &lt;!-- Hibernate properties --&gt;         &lt;properties&gt;             &lt;property name=&quot;hibernate.dialect&quot; value=&quot;org.hibernate.dialect.HSQLDialect&quot;\/&gt;             &lt;property name=&quot;hibernate.ejb.naming_strategy&quot; value=&quot;org.hibernate.cfg.ImprovedNamingStrategy&quot;\/&gt;             &lt;property name=&quot;hibernate.connection.charSet&quot; value=&quot;UTF-8&quot;\/&gt;             &lt;property name=&quot;hibernate.validator.apply_to_ddl&quot; value=&quot;false&quot;\/&gt;             &lt;property name=&quot;hibernate.validator.autoregister_listeners&quot; value=&quot;false&quot;\/&gt;             &lt;property name=&quot;hibernate.show_sql&quot; value=&quot;true&quot;\/&gt;             &lt;property name=&quot;hibernate.hbm2ddl.auto&quot; value=&quot;validate&quot;\/&gt;         &lt;\/properties&gt;     &lt;\/persistence-unit&gt; &lt;\/persistence&gt; <\/code><\/pre>\n<p>  \u041e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 \u00abhibernate.hbm2ddl.auto\u00bb \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u00abupdate\u00bb \u0432\u043c\u0435\u0441\u0442\u043e \u00abvalidate\u00bb, \u0442\u043e hibernate \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0438\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b. \u042d\u0442\u043e \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043b\u0435\u0433\u043a\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c, \u0447\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 sql \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u0432\u0430 \u0444\u0430\u043a\u0442\u0430 <br \/>  \u0430) hibernate \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435 \u0434\u0435\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u043d\u0435\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f.<br \/>  \u0431) \u0412\u0441\u044e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u043c\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u043c\u0438.<br \/>  \u041f\u043e \u043c\u0435\u0440\u0435 \u0440\u043e\u0441\u0442\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442.<\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u0438 DAO. \u0427\u0442\u043e-\u0447\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439. <br \/>  User.java- \u043e\u0431\u0435\u0440\u0442\u043a\u0430 \u043d\u0430\u0434 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439. \u0421\u0430\u043c \u043a\u043b\u0430\u0441\u0441 \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439  <a href=\"http:\/\/habrahabr.ru\/users\/entity\/\" class=\"user_link\">Entity<\/a>. \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437  <a href=\"http:\/\/habrahabr.ru\/users\/table\/\" class=\"user_link\">Table<\/a>. \u041a\u043b\u0430\u0441\u0441 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432.  <\/p>\n<pre><code class=\"java\">@Entity @Table(name = User.TABLE) public class User { \u2026 } <\/code><\/pre>\n<p>  \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043d\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043f\u043e\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u043e\u043c\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439  @Column \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0438\u043c\u0435\u043d\u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u0430. \u0414\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 get \u0438 set \u043c\u0435\u0442\u043e\u0434\u044b.  <\/p>\n<pre><code class=\"java\">@Column(name = COLUMN_USER_NAME) private String userName; <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">User.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.intetm.db.entity;  import javax.persistence.*; import java.util.ArrayList; import java.util.List; import java.util.UUID;  @Entity @Table(name = User.TABLE) public class User {     public static final String TABLE = &quot;Users&quot;;     public static final String COLUMN_ID = &quot;id&quot;;     public static final String COLUMN_USER_NAME = &quot;userName&quot;;     public static final String COLUMN_PASSWORD = &quot;password&quot;;     public static final String COLUMN_ENABLED = &quot;enabled&quot;;      @Id     @Column(name = COLUMN_ID, columnDefinition = &quot;BINARY(16)&quot;)     private UUID id;      @Column(name = COLUMN_USER_NAME)     private String userName;      @Column(name = COLUMN_PASSWORD)     private String password;      @Column(name = COLUMN_ENABLED)     private boolean enabled;      @ElementCollection(targetClass = Authority.class)     @Enumerated(EnumType.STRING)     @CollectionTable(name = Authority.TABLE, joinColumns = @JoinColumn(name = Authority.COLUMN_USERID, referencedColumnName = COLUMN_ID))     @Column(name = Authority.COLUMN_AUTHORITY)     private List&lt;Authority&gt; authorities;      public User() {     }      public User(String userName, String password, Authority authority) {         this.userName = userName;         this.password = password;         this.enabled = true;         this.authorities = new ArrayList&lt;&gt;();         this.authorities.add(authority);     }      public UUID getId() {         return id;     }      public void setId(UUID id) {         this.id = id;     }      public String getUserName() {         return userName;     }      public void setUserName(String userName) {         this.userName = userName;     }      public String getPassword() {         return password;     }      public void setPassword(String password) {         this.password = password;     }      public boolean isEnabled() {         return enabled;     }      public void setEnabled(boolean enabled) {         this.enabled = enabled;     }      public List&lt;Authority&gt; getAuthorities() {         return authorities;     }      public void setAuthorities(List&lt;Authority&gt; authorities) {         this.authorities = authorities;     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  Authority.java \u2014 \u041f\u0440\u043e\u0441\u0442\u043e\u0439 enum, \u0431\u0435\u0437 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439. \u0412\u0441\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u043d\u0430 \u0441\u0432\u044f\u0437\u044c \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0432 User.java. \u0412 \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u044b \u043b\u0438\u0448\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Authority.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.intetm.db.entity;  public enum Authority {     ROLE_ADMIN,     ROLE_USER,     ROLE_ANONYMOUS;     public static final String TABLE = &quot;authorities&quot;;     public static final String COLUMN_USERID = &quot;userid&quot;;     public static final String COLUMN_AUTHORITY = &quot;authority&quot;; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  AbstractDao \u2014 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u043a \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0434\u0430\u043e. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0432\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438  @PersistenceContext \u0438  @PersistenceUnit, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c Spring \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442 \u043a\u0443\u0434\u0430 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c entityManager \u0438 entityManagerFactory. \u0422\u0430\u043a \u0436\u0435 \u0435\u0441\u0442\u044c \u043e\u0431\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.  <\/p>\n<pre><code class=\"java\">    @PersistenceContext     private EntityManager entityManager;     @PersistenceUnit     private EntityManagerFactory entityManagerFactory; <\/code><\/pre>\n<div class=\"spoiler\"><b class=\"spoiler_title\">AbstractDao.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.intetm.db.dao;  import javax.persistence.*; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Path; import javax.persistence.criteria.Root; import java.util.List; import java.util.Map;  public abstract class AbstractDao&lt;Entity, ID&gt; {     private final Class entryClass;      @PersistenceContext     private EntityManager entityManager;     @PersistenceUnit     private EntityManagerFactory entityManagerFactory;      public AbstractDao(Class entryClass) {         this.entryClass = entryClass;     }      public void persist(Entity entity) {         entityManager.persist(entity);     }      public void merge(Entity entity) {         entityManager.merge(entity);     }      public void delete(Entity entity) {         entityManager.remove(entity);     }      @SuppressWarnings(&quot;unchecked&quot;)     public CriteriaQuery&lt;Entity&gt; createCriteriaQuery() {         return this.getCriteriaBuilder().createQuery(entryClass);     }       @SuppressWarnings(&quot;unchecked&quot;)     public Entity find(ID id) {         return (Entity) entityManager.find(entryClass, id);     }      public List&lt;Entity&gt; find(CriteriaQuery&lt;Entity&gt; criteriaQuery) {         TypedQuery&lt;Entity&gt; query = entityManager.createQuery(criteriaQuery);         return query.getResultList();     }      public List&lt;Entity&gt; find(Object... keysAndValues) {         CriteriaBuilder criteriaBuilder = this.getCriteriaBuilder();         CriteriaQuery&lt;Entity&gt; criteriaQuery = this.createCriteriaQuery();         Root root = criteriaQuery.from(entryClass);         fillQuery(criteriaQuery, keysAndValues, root, criteriaBuilder);         return find(criteriaQuery);     }       public List&lt;Entity&gt; find(Map&lt;String, Object&gt; parameters) {         Object[] array = toArray(parameters);         return find(array);     }      @SuppressWarnings(&quot;unchecked&quot;)     public long count(Object... keysAndValues) {         CriteriaBuilder criteriaBuilder = this.getCriteriaBuilder();         CriteriaQuery&lt;Long&gt; criteriaQuery = criteriaBuilder.createQuery(Long.class);         Root&lt;Entity&gt; root = criteriaQuery.from(entryClass);         criteriaQuery.select(criteriaBuilder.count(root));         fillQuery(criteriaQuery, keysAndValues, root, criteriaBuilder);         return getEntityManager().createQuery(criteriaQuery).getSingleResult();     }      public long count(Map&lt;String, Object&gt; parameters) {         Object[] array = toArray(parameters);         return count(array);     }      private void fillQuery(CriteriaQuery criteriaQuery, Object[] keysAndValues, Root root, CriteriaBuilder criteriaBuilder) {         if (keysAndValues.length % 2 != 0) {             throw new IllegalArgumentException(&quot;Expected even count argument, receive odd&quot;);         }         for (int i = 0; i &lt; keysAndValues.length; i += 2) {             Path parameterPath = root.get((String) keysAndValues[i]);             Object parameterValue = keysAndValues[i + 1];             criteriaQuery.where(criteriaBuilder.equal(parameterPath, parameterValue));         }     }      private Object[] toArray(Map&lt;String, Object&gt; parameters) {         Object[] array = new Object[parameters.size() * 2];         int i = 0;         for (Map.Entry&lt;String, Object&gt; parameter : parameters.entrySet()) {             array[i] = parameter.getKey();             i++;             array[i] = parameter.getValue();             i++;         }         return array;     }       public List&lt;Entity&gt; selectAll() {         CriteriaQuery&lt;Entity&gt; criteriaQuery = createCriteriaQuery();         criteriaQuery.from(entryClass);         return find(criteriaQuery);     }       public EntityManager getEntityManager() {         return entityManager;     }      public void setEntityManager(EntityManager entityManager) {         this.entityManager = entityManager;     }      public Object getEntityManagerFactory() {         return entityManagerFactory;     }      public void setEntityManagerFactory(EntityManagerFactory entityManagerFactory) {         this.entityManagerFactory = entityManagerFactory;     }      public CriteriaBuilder getCriteriaBuilder() {         return this.entityManager.getCriteriaBuilder();     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  UserDao \u2014 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Dao \u0434\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b User. \u041f\u043e\u043c\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 @ Repository, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 Spring \u043d\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u0438\u043d\u0430. Spring \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u043f\u043e\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 \u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c\u0438  @PersistenceContext \u0438  @PersistenceUnit, \u043d\u0430\u0439\u0434\u0435\u0442 \u0438\u0445 \u0432 \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 AbstractDao \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442.   <\/p>\n<pre><code class=\"java\">@Repository(&quot;userDao&quot;) public class UserDao extends AbstractDao&lt;User, UUID&gt; <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">UserDao.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.intetm.db.dao;  import com.intetm.db.entity.User; import org.springframework.stereotype.Repository;  import java.util.UUID;  @Repository(&quot;userDao&quot;) public class UserDao extends AbstractDao&lt;User, UUID&gt; {      public UserDao() {         super(User.class);     }      @Override     public void persist(User user) {         if (user.getId() == null) {             user.setId(UUID.randomUUID());         }         super.persist(user);     }      public boolean isUserExsist(String userName) {         return count(User.COLUMN_USER_NAME, userName) != 0;     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a name=\"Rest\"><\/a><\/p>\n<h4>REST \u0441\u0435\u0440\u0432\u0438\u0441<\/h4>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ef1\/3ab\/4ed\/ef13ab4edfac49ab80fb6a07a9fd6174\"\/><br \/>  Rest \u0441\u0435\u0440\u0432\u0438\u0441 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u0447\u043a\u043e\u0439 \u0432\u0445\u043e\u0434\u0430 \u0438 \u0432\u044b\u0445\u043e\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0432\u044b\u0442\u0435\u043a\u0430\u044e\u0449\u0438\u043c\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u043c\u0438. \u0412\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u043e\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0437\u0430\u0432\u0435\u0434\u043e\u043c\u043e \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043e\u0448\u0438\u0431\u043e\u043a. \u041f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u043d \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0435\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 stacktrace. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 \u2014 \u044d\u0442\u043e \u043e\u0442\u043a\u0430\u0442 \u0432\u0441\u0435\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u043e\u0442\u0434\u0430\u0447\u0430 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0443. <br \/>   \u041f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0412\u043d\u0430\u0447\u0430\u043b\u0435 \u043e\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. \u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u0431\u0440\u043e\u0441\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443. \u0412 \u0434\u0440\u0443\u0433\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0445\u0435\u0448\u0438\u0440\u0443\u0435\u0442 \u043f\u0430\u0440\u043e\u043b\u044c \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">LoginService<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.intetm.service.login;  import com.intetm.db.dao.UserDao; import com.intetm.db.entity.Authority; import com.intetm.db.entity.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.transaction.annotation.Transactional;  public class LoginService {     @Autowired     private UserDao userDao;     @Autowired     private PasswordEncoder encoder;      @Transactional     public User createUser(String userName, String password, Authority authority) throws UserExistsException {         if (userDao.isUserExsist(userName)) {             throw new UserExistsException(userName);         }         String hash = encoder.encode(password);         User user = new User(userName, hash, authority);         userDao.persist(user);         return user;     }       public UserDao getUserDao() {         return userDao;     }      public void setUserDao(UserDao userDao) {         this.userDao = userDao;     }      public PasswordEncoder getEncoder() {         return encoder;     }      public void setEncoder(PasswordEncoder encoder) {         this.encoder = encoder;     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c\u043e\u0435 \u0438\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">UserExistsException<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.intetm.service.login;  public class UserExistsException extends Exception {     public UserExistsException(String userName) {         super(&quot;User &quot; + userName + &quot; already exists!&quot;);     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 LoginController \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435. \u041e\u043d \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u0432\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 (\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043f\u0430\u0440\u043e\u043b\u044c) \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u043b\u0438 \u0431\u0440\u043e\u0441\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443. Stacktrace \u043c\u044b \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u043d\u0435 \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0430 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438.   <\/p>\n<pre><code class=\"java\">  @RequestMapping(value = &quot;\/createUser&quot;, produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)     @ResponseBody     public UserDetails createUser(@RequestParam String username, @RequestParam String password) throws ServiceException {         try {             User user = loginService.createUser(username, password, ROLE_USER);             return new UserDetails(user);         } catch (UserExistsException exception) {             throw new ServiceException(exception.getMessage());         }     } <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">LoginController<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.intetm.web.login;  import com.intetm.db.entity.User; import com.intetm.service.login.LoginService; import com.intetm.service.login.UserExistsException; import com.intetm.web.exception.ServiceException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody;  import static com.intetm.db.entity.Authority.ROLE_USER;  @Controller public class LoginController {     private static final Logger logger = LoggerFactory.getLogger(LoginController.class);     private static final String HELLO_VIEW = &quot;hello&quot;;      @Autowired     private LoginService loginService;       @RequestMapping(value = &quot;\/hello&quot;, method = RequestMethod.GET)     public String hello(Model model) {         logger.debug(&quot;hello page&quot;);         model.addAttribute(&quot;subject&quot;, &quot;world&quot;);         return HELLO_VIEW;     }      @RequestMapping(value = &quot;\/createUser&quot;, produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)     @ResponseBody     public UserDetails createUser(@RequestParam String username, @RequestParam String password) throws ServiceException {         try {             User user = loginService.createUser(username, password, ROLE_USER);             return new UserDetails(user);         } catch (UserExistsException exception) {             throw new ServiceException(exception.getMessage());         }     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d \u0432 json.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">UserDetails<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.intetm.web.login;  import com.intetm.db.entity.Authority; import com.intetm.db.entity.User;  import java.util.List;  class UserDetails {     private String userName;     private List&lt;Authority&gt; authorities;      public UserDetails(User user) {         this.userName = user.getUserName();         this.authorities = user.getAuthorities();     }      public String getUserName() {         return userName;     }      public void setUserName(String userName) {         this.userName = userName;     }      public List&lt;Authority&gt; getAuthorities() {         return authorities;     }      public void setAuthorities(List&lt;Authority&gt; authorities) {         this.authorities = authorities;     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0439\u043c\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438\u0445 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a. \u041e\u043d \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439  @ControllerAdvice<br \/>  . \u0415\u0441\u043b\u0438 \u0432 \u0445\u043e\u0434\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442 \u043e\u0448\u0438\u0431\u043a\u0438, \u0442\u043e Spring \u043f\u043e\u0438\u0449\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u0440\u0435 \u0438 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u0430 \u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 ExceptionHandler. \u0415\u0441\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u0442, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0440\u0430\u0449\u0435\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u0435\u0442\u043e\u0434\u0430. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u0430\u0436\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ExceptionController<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.intetm.web.exception;  import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;  @ControllerAdvice public class ExceptionController extends ResponseEntityExceptionHandler {     private static final Logger logger = LoggerFactory.getLogger(ExceptionController.class);      @ExceptionHandler(ServiceException.class)     @ResponseBody     @ResponseStatus(code = HttpStatus.BAD_REQUEST)     public String handleServiceException(ServiceException ex) {         if (ex.isNeedLogging()) {             logger.error(ex.getMessage(), ex);         }         return ex.getMessage();     }      @ExceptionHandler(RuntimeException.class)     @ResponseBody     @ResponseStatus(code = HttpStatus.INTERNAL_SERVER_ERROR)     public String handleException(RuntimeException ex) {         logger.error(ex.getMessage(), ex);         return ex.getMessage();     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0411\u0440\u043e\u0441\u0430\u0435\u043c\u043e\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u0440\u043e\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0435\u0433\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043d\u0430\u0434\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ServiceException<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">package com.intetm.web.exception;  public class ServiceException extends Exception {      private boolean needLogging = false;      public ServiceException() {         super();     }      public ServiceException(String message) {         super(message);     }      public ServiceException(boolean needLogging) {         super();         this.needLogging = needLogging;     }      public ServiceException(String message, boolean needLogging) {         super(message);         this.needLogging = needLogging;     }      public boolean isNeedLogging() {         return needLogging;     }      public void setNeedLogging(boolean needLogging) {         this.needLogging = needLogging;     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0412 javascript \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">login.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">$(function () {     $(&quot;#tabs&quot;).tabs(); });  $(document).ready(function () {     var frm = $(&quot;#formCreate&quot;)     frm.submit(function (event) {         event.preventDefault();         $.ajax({             type: frm.attr('method'),             url: frm.attr('action'),             data: frm.serialize(),             success: function (data) {                 alert('Username:' + data.userName + &quot;\\nrole:&quot; + data.authorities[0]);             },             error: function (xhr, str) {                 alert('User exist!');             }         });         return false;     }); }); <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u043b\u043e\u0447\u0435\u0439. \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0431\u0438\u043d \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0449\u0438\u0439 Java \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 json.  <\/p>\n<pre><code class=\"xml\">&lt;bean id=&quot;jacksonMessageConverter&quot;           class=&quot;org.springframework.http.converter.json.MappingJackson2HttpMessageConverter&quot;\/&gt;     &lt;bean class=&quot;org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter&quot;&gt;         &lt;property name=&quot;messageConverters&quot;&gt;             &lt;list&gt;                 &lt;ref bean=&quot;jacksonMessageConverter&quot;\/&gt;             &lt;\/list&gt;         &lt;\/property&gt;     &lt;\/bean&gt; <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\u0412 build.gradle \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043f\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0449\u0443\u044e java \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 json.   <\/p>\n<pre><code class=\"bash\"> compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: gradle.jacksonVersion  compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: gradle.jacksonVersion <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">buildscript {     repositories {         mavenLocal()         mavenCentral()         jcenter()     }     dependencies {         classpath group: 'org.hsqldb', name: 'hsqldb', version: gradle.hsqldbVersion     } }  plugins {     id &quot;org.akhikhl.gretty&quot; version &quot;1.2.4&quot;     id 'org.liquibase.gradle' version '1.1.1'     id &quot;com.eriwen.gradle.js&quot; version &quot;1.12.1&quot;     id &quot;com.eriwen.gradle.css&quot; version &quot;1.11.1&quot; }  group 'com.intetm' version '0.1'  apply plugin: 'java' apply plugin: 'war' apply from: 'database.gradle'  \/\/noinspection GroovyUnusedAssignment sourceCompatibility = 1.8  repositories {     mavenCentral() }  dependencies {     compile group: 'javax', name: 'javaee-api', version: gradle.javaxVersion      runtime group: 'org.springframework', name: 'spring-jdbc', version: gradle.springVersion     compile group: 'org.springframework', name: 'spring-webmvc', version: gradle.springVersion     compile group: 'org.springframework', name: 'spring-orm', version: gradle.springVersion     compile group: 'org.springframework', name: 'spring-tx', version: gradle.springVersion      compile group: 'org.springframework.security', name: 'spring-security-web', version: gradle.springSecurityVersion     runtime group: 'org.springframework.security', name: 'spring-security-config', version: gradle.springSecurityVersion      runtime group: 'org.hibernate.javax.persistence', name: 'hibernate-jpa-2.1-api', version: gradle.hibernateJpaVersion     runtime group: 'org.hibernate', name: 'hibernate-core', version: gradle.hibernateVersion     runtime group: 'org.hibernate', name: 'hibernate-entitymanager', version: gradle.hibernateVersion      compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: gradle.jacksonVersion     compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: gradle.jacksonVersion       compile group: 'org.slf4j', name: 'slf4j-api', version: gradle.slf4jVersion     runtime group: 'ch.qos.logback', name: 'logback-classic', version: gradle.logbackVersion      runtime group: 'org.apache.taglibs', name: 'taglibs-standard-impl', version: gradle.jstlVersion      gretty group: 'org.hsqldb', name: 'hsqldb', version: gradle.hsqldbVersion }  def serverHttpPort = project.properties['serverHttpPort'] ?: gradle.serverHttpPort def serverResourcesPath = project.properties['serverResourcesPath'] ?: gradle.serverResourcesPath def serverContextFile = project.properties['serverContextFile'] ?: gradle.serverContextFile def serverClassPath = [project.properties['serverClassPath'] ?: gradle.serverClassPath] as Set def dbUser = project.properties['dbUser'] ?: gradle.dbUser def dbPassword = project.properties['dbPassword'] ?: gradle.dbPassword def dbUrl = project.properties['dbUrl'] ?: gradle.dbUrl  gretty {     httpPort = serverHttpPort     serverConfigFile = serverContextFile     classPath = serverClassPath     inplaceMode = &quot;hard&quot; }  task copyEnvironment(type: Copy) {     group = 'develop'     from 'src\/test\/resources\/environment'     into serverResourcesPath }  liquibase {     activities {         \/\/noinspection GroovyAssignabilityCheck         main {             changeLogFile 'src\/sql\/main\/changelog.xml'             url dbUrl             username dbUser             password dbPassword         }         dev {             changeLogFile 'src\/sql\/dev\/changelog.xml'             url dbUrl             username dbUser             password dbPassword         }     } } task updateDbMain(dependsOn: startDatabase) {     group = 'develop'     doLast {         liquibase.runList = 'main'         tasks.update.execute()     } }  task updateDbDev(dependsOn: startDatabase) {     group = 'develop'     doLast {         liquibase.runList = 'main, dev'         tasks.update.execute()     } }  javascript.source {     login {         js {             srcDir &quot;src\/main\/js\/login&quot;             include &quot;*.js&quot;         }     } }  combineJs {     source = javascript.source.login.js.files     \/\/noinspection GrReassignedInClosureLocalVar     dest = file(&quot;${buildDir}\/js\/combine\/login.js&quot;) }  minifyJs {     source = combineJs     \/\/noinspection GrReassignedInClosureLocalVar     dest = file(&quot;${buildDir}\/js\/min\/login.js&quot;)     \/\/sourceMap = file(&quot;${buildDir}\/js\/min\/login.sourcemap.json&quot;)     closure {         warningLevel = 'QUIET'     } }  css.source {     login {         css {             srcDir &quot;src\/main\/css\/login&quot;             include &quot;*.css&quot;         }     } }  combineCss {     source = css.source.login.css.files     \/\/noinspection GrReassignedInClosureLocalVar     dest = file(&quot;${buildDir}\/css\/combine\/login.css&quot;) }  minifyCss {     source = combineCss     dest = file(&quot;${buildDir}\/css\/min\/login.css&quot;)     yuicompressor { \/\/ Optional         lineBreakPos = -1     } }  def dev = true; task copyJs(type: Copy) {     group = 'develop'     from(dev ? combineJs : minifyJs) as String     into &quot;src\/main\/webapp\/js&quot; } task copyCss(type: Copy) {     group = 'develop'     from(dev ? combineCss : minifyCss) as String     into &quot;src\/main\/webapp\/css&quot; }  compileJava.dependsOn.add(copyJs) compileJava.dependsOn.add(copyCss) <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0423\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e settings.gradle  <\/p>\n<pre><code class=\"bash\">gradle.ext.jacksonVersion = '2.3.0' <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0444\u0430\u0439\u043b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">rootProject.name = 'gull' \/\/lib version gradle.ext.springVersion = '4.2.2.RELEASE' gradle.ext.springSecurityVersion = '4.0.2.RELEASE' gradle.ext.javaxVersion = '7.0' gradle.ext.hibernateVersion = '5.0.2.Final' gradle.ext.hibernateJpaVersion = '1.0.0.Final' gradle.ext.slf4jVersion = '1.7.13' gradle.ext.logbackVersion = '1.1.3' gradle.ext.hsqldbVersion = '2.3.2' gradle.ext.jacksonVersion = '2.3.0' gradle.ext.jstlVersion = '1.2.5' \/\/default server config gradle.ext.serverHttpPort = 8080 gradle.ext.serverResourcesPath = &quot;dev\/resources&quot; gradle.ext.serverContextFile = &quot;src\/test\/resources\/environment\/jetty-context.xml&quot; gradle.ext.serverClassPath = &quot;src\/test\/resources\/environment\/classpath&quot; \/\/default database config gradle.ext.dbName = &quot;xdb&quot; gradle.ext.dbFile = &quot;dev\/database\/devDB&quot; gradle.ext.dbUser = &quot;SA&quot; gradle.ext.dbPassword = &quot;password&quot; gradle.ext.dbPort = 9001 gradle.ext.dbHost = &quot;localhost&quot; gradle.ext.dbUrl = &quot;jdbc:hsqldb:hsql:\/\/${gradle.dbHost}:${gradle.dbPort}\/${gradle.dbName}&quot; gradle.ext.dbDrive = &quot;org.hsqldb.jdbc.JDBCDriver&quot; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439.   <\/p>\n<pre><code class=\"xml\">    &lt;tx:annotation-driven transaction-manager=&quot;transactionManager&quot;\/&gt; <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">dispatcher-servlet.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt; &lt;beans xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;        xmlns:mvc=&quot;http:\/\/www.springframework.org\/schema\/mvc&quot;        xmlns:context=&quot;http:\/\/www.springframework.org\/schema\/context&quot;        xmlns:tx=&quot;http:\/\/www.springframework.org\/schema\/tx&quot;        xmlns=&quot;http:\/\/www.springframework.org\/schema\/beans&quot;        xsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd            http:\/\/www.springframework.org\/schema\/mvc http:\/\/www.springframework.org\/schema\/mvc\/spring-mvc.xsd            http:\/\/www.springframework.org\/schema\/context http:\/\/www.springframework.org\/schema\/context\/spring-context.xsd            http:\/\/www.springframework.org\/schema\/tx http:\/\/www.springframework.org\/schema\/tx\/spring-tx.xsd&quot;&gt;      &lt;!-- \u0431\u0438\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0433\u0434\u0435 \u043b\u0435\u0436\u0430\u0442 jsp \u0434\u043b\u044f view --&gt;     &lt;bean class=&quot;org.springframework.web.servlet.view.InternalResourceViewResolver&quot;&gt;         &lt;property name=&quot;prefix&quot; value=&quot;\/WEB-INF\/jsp\/&quot;\/&gt;         &lt;property name=&quot;suffix&quot; value=&quot;.jsp&quot;\/&gt;     &lt;\/bean&gt;      &lt;mvc:view-controller path=&quot;\/&quot; view-name=&quot;index&quot;\/&gt;     &lt;mvc:view-controller path=&quot;\/login&quot; view-name=&quot;login&quot;\/&gt;      &lt;mvc:resources mapping=&quot;\/js\/**&quot; location=&quot;\/js\/&quot;\/&gt;     &lt;mvc:resources mapping=&quot;\/css\/**&quot; location=&quot;\/css\/&quot;\/&gt;       &lt;!--\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 mvc --&gt;     &lt;mvc:annotation-driven\/&gt;     &lt;!--\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0432 \u043a\u0430\u043a\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a --&gt;     &lt;context:component-scan base-package=&quot;com.intetm.web&quot;\/&gt;      &lt;tx:annotation-driven transaction-manager=&quot;transactionManager&quot;\/&gt;     &lt;bean id=&quot;loginService&quot; class=&quot;com.intetm.service.login.LoginService&quot;\/&gt;      &lt;bean id=&quot;jacksonMessageConverter&quot;           class=&quot;org.springframework.http.converter.json.MappingJackson2HttpMessageConverter&quot;\/&gt;     &lt;bean class=&quot;org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter&quot;&gt;         &lt;property name=&quot;messageConverters&quot;&gt;             &lt;list&gt;                 &lt;ref bean=&quot;jacksonMessageConverter&quot;\/&gt;             &lt;\/list&gt;         &lt;\/property&gt;     &lt;\/bean&gt; &lt;\/beans&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>   \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u043d\u0435\u043c\u0430\u043b\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u042d\u0442\u043e \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u0438 \u0438 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0414\u0430\u043d\u043d\u043e\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e, \u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u0438\u043c\u0435\u0440. \u041f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439.<br \/>  1) Dao \u2014 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435, \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430, \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0441\u0438\u0442\u044c Runtime Exception, \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. <br \/>  2) Service \u2014 \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b. \u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0442\u043e\u0447\u043a\u0430\u043c\u0438 \u0432\u0445\u043e\u0434\u0430, \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u044b\u043c. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b Dao, \u043d\u043e \u0432\u044b\u0437\u043e\u0432\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438. \u0415\u0434\u0438\u043d\u0430\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u043d\u0430 \u0432\u0441\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043e\u0442\u043a\u0430\u0442\u0438\u0442\u044c \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0438 \u043e\u0448\u0438\u0431\u043a\u0438. <br \/>   \u0414\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438, \u043d\u0430\u0434\u043e \u0437\u043d\u0430\u0442\u044c \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b. \u041d\u0438\u0447\u0435\u0433\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0432 \u043d\u0435\u043c \u043d\u0435 \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f. \u0423\u0432\u0438\u0434\u0435\u0432 \u0434\u0430\u043d\u043d\u0443\u044e transactional Spring \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0431\u0438\u043d \u0432 \u043f\u0440\u043e\u043a\u0441\u0438. \u041a\u043e\u0434 \u043f\u0440\u043e\u043a\u0441\u0438 \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c  <\/p>\n<pre><code class=\"java\">public void someMethod(){         transaction.open();         try{             subject.someMethod();         }         catch(Exception exception){             transaction.setRollbackOnly(true);         }         finally {             transaction.close();         }     } <\/code><\/pre>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430, \u043f\u0440\u043e\u043a\u0441\u0438 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u043f\u0440\u043e\u043a\u0441\u0438. \u041f\u0440\u043e\u043a\u0441\u0438 \u043e\u0442\u0440\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e \u043d\u0430\u0434\u043e \u043e\u0442\u043a\u0430\u0442\u0438\u0442\u044c \u0438 \u043f\u0435\u0440\u0435\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0435\u043c\u0443 \u043a\u043b\u0430\u0441\u0441\u0443 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e. \u041f\u043e\u043d\u0438\u043c\u0430\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0432\u0430 \u0432\u0430\u0436\u043d\u044b\u0445 \u0432\u044b\u0432\u043e\u0434\u0430. <br \/>   \u041f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 \u043c\u0435\u0442\u043e\u0434\u0430, \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u043e\u0442\u043a\u0430\u0442\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u0435\u0442\u043e\u0434\u044b Service, \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044e. \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445, \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Dao, \u0447\u0442\u043e \u0432 \u043a\u043e\u0440\u043d\u0435 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0415\u0441\u043b\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 Service \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0432\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u0430 Dao, \u0442\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445! \u0412\u0435\u0434\u044c \u043a \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u043f\u0435\u0440\u0432\u0430\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f \u0443\u0436\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u043b\u0430\u0441\u044c!<br \/>   \u0412\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u0432\u043e\u0434 \u0431\u043e\u043b\u0435\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u0435\u043d \u2014 \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043a\u0441\u0438, \u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0431\u0438\u043d\u0430. \u041f\u0440\u043e\u043a\u0441\u0438 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u044b\u0437\u043e\u0432\u044b \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0431\u0438\u043d\u0430\u043c\u0438 \u0438 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0430. <br \/>   \u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043e\u0431\u044f\u0437\u0430\u043d\u043d\u043e\u0441\u0442\u044f\u043c \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043e\u0448\u0438\u0431\u043e\u043a, \u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 Service \u044f \u0434\u0435\u043b\u0430\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u043e\u0441\u044c \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a, \u0442\u043e \u043a\u043b\u0430\u0441\u0441 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0442\u0434\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0415\u0441\u043b\u0438 \u0432\u0445\u043e\u0434\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 Dao \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430, \u0442\u043e \u043e\u043d\u0430 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0432\u0435\u0440\u0445 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043e\u0442\u043a\u0430\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. <br \/>   \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0430, Service \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u043e\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u041e\u043d\u0438 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u0435\u043d, \u0438 \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c. \u041f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e-\u043e\u0441\u043e\u0431\u043e\u043c\u0443. \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0434\u0430\u0436\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043b\u043e\u0433\u0438\u043a\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<br \/>  <b>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<\/b> \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u0442\u043a\u0430\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 Runtime Exception. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b \u043e\u0442\u043a\u0430\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u044b\u0445 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439, \u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 rollbackFor. \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430:  <\/p>\n<pre><code class=\"java\">  @Transactional(rollbackFor = Exception.class)     public void someMethod() throws Exception {         ...     } <\/code><\/pre>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u043e\u0442\u043a\u0430\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438.<br \/>  3) Controller \u2014 \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441. \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0432 Service. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0438\u0437 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u2014 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u0432\u0435\u0442. \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0435\u0440\u0435\u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c. \u0425\u043e\u0442\u044f \u0435\u0433\u043e \u0440\u043e\u043b\u044c \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439, \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u0438\u0442\u044c \u0435\u0433\u043e \u0441 Service. \u041d\u0430 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u043d\u0430, \u043d\u043e \u043f\u043e\u0442\u043e\u043c \u0438\u0445 \u0447\u0438\u0441\u043b\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0440\u0430\u0441\u0442\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0441\u043e \u0441\u0432\u043e\u0438\u043c API.<br \/>  4) Controller advice \u2014 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u0440\u0443, \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438. \u041f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 Runtime Exception, \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043b\u043e\u0433 \u0438 \u043e\u0442\u0434\u0430\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043b\u0438\u0448\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c\u044b\u0445 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0434\u0440\u0443\u0433\u0430\u044f. \u041e\u043d\u0438 \u0442\u043e\u0436\u0435 \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f, \u043d\u043e \u0432 \u043b\u043e\u0433 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0435 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u0444\u043b\u0430\u0433\u043e\u043c \u043e\u0448\u0438\u0431\u043a\u0438. \u041f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043f\u0440\u0438\u0440\u043e\u0434\u043e\u0439 \u043e\u0448\u0438\u0431\u043e\u043a. \u041f\u0435\u0440\u0432\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438 \u043e\u0431\u044f\u0437\u0430\u043d\u044b \u0431\u044b\u0442\u044c \u0437\u0430\u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b. \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043b\u0438\u0448\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u044f \u0432 \u043b\u043e\u0433\u0435.<\/p>\n<p>  \u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. <\/p>\n<p>  \u0425\u043e\u0442\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0439\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c-\u0442\u043e \u0438 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u2018Hello, world!\u2019, \u043e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043b\u0438\u0448\u044c \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438 \u0442\u043e \u043d\u0435 \u0432\u0441\u0435. \u0417\u0430 \u0431\u043e\u0440\u0442\u043e\u043c \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0442\u0430\u043a\u0438\u0435 \u0430\u0440\u0445\u0438\u0432\u0430\u0436\u043d\u044b\u0435 \u0432\u0435\u0449\u0438, \u043a\u0430\u043a \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f. \u0411\u0435\u0437 \u043d\u0438\u0445 \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u044b\u043c. <br \/>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 <a href=\"https:\/\/github.com\/intet\/gull\">github<\/a>. \u0417\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u043a\u0438.   <\/p>\n<pre><code class=\"bash\">gradlew updateDbDev gradlew jettyStart <\/code><\/pre>\n<p>  \u041f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 JDK. \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u043b\u0435\u0442\u0443. \u041d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u043e\u043d\u043e\u043b\u0438\u0442\u043d\u044b\u043c. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0432\u043d\u0435\u0448\u043d\u044e\u044e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u043e\u0432, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0435\u0437 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u0441 VCS.               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/271719\/\"> http:\/\/habrahabr.ru\/post\/271719\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/200\/413\/9d3\/2004139d3c1042a69ae608ca5422ee60.png\"\/><br \/>  \u0421\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432. \u041d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u043b\u0438\u0448\u044c JDK, \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0438 \u0441\u0430\u043c \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044f \u043d\u0430\u043b\u0435\u0442\u0443. \u041d\u0430\u0434\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u043f\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0434\u0432\u0443\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: \u0437\u0430\u043f\u0443\u0441\u043a \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 SQL \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e Java, Javascript \u0438 CSS \u0444\u0430\u0439\u043b\u043e\u0432, \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u043e\u0432. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Gradle, HSQLDB, Liquibase, Google closure compile \u0438 Gretty. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-269831","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/269831","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=269831"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/269831\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=269831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=269831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=269831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}