{"id":255295,"date":"2015-04-15T17:01:02","date_gmt":"2015-04-15T13:01:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=255295"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=255295","title":{"rendered":"Java-based \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 embedded Jetty\/Spring MVC\/Spring Security"},"content":{"rendered":"<p>     \t<habracut\/>\u041a\u043e\u043c\u0443-\u0442\u043e \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e xml-\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0435\u0441\u043b\u0438 \u043d\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0442\u043e\u0447\u043d\u043e, \u043a\u043e\u043c\u0443-\u0442\u043e \u043d\u0435\u0442. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u044f \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0430 <i>persistence.xml<\/i> \u0443\u0448\u043b\u0438 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u2014 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0414\u0411 \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439, \u0430 \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432. \u0412\u044b\u0432\u043e\u0434 \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d: \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0435 \u0441\u0442\u0440\u0430\u0434\u0430\u0435\u0442 \u0430\u043d\u0430\u0445\u0440\u043e\u043d\u0438\u0437\u043c\u043e\u043c, \u0442\u043e \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u0443\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u2014 \u0447\u0430\u0441\u0442\u044c \u0432 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u0445, \u0447\u0430\u0441\u0442\u044c \u0432 xml-\u0444\u0430\u0439\u043b\u0430\u0445. \u042d\u0442\u043e \u043d\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0438 \u043d\u0435 \u043f\u043b\u043e\u0445\u043e, \u044d\u0442\u043e \u0434\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u2014 \u0432\u0441\u0435 \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438 \u043a <i>web.xml<\/i>, <i>application.xml<\/i>, <i>springmvc-servlet.xml<\/i> \u0438 \u0442.\u0434., \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c\u0438 <i>@ Controller, @ Repository, @ Autowired, @ Value, @ ResponseBody<\/i> \u0438 \u0442.\u0434. \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 3 Spring \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <b>Java-based \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/b>, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 xml-\u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0420\u0430\u043d\u0435\u0435 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 <a href=\"http:\/\/habrahabr.ru\/company\/jugru\/blog\/218203\">\u0431\u044b\u043b\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0441 \u0430\u043d\u0430\u043b\u0438\u0437\u043e\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432 \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432 \u043e\u0434\u043d\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043f\u0435\u0440\u0435\u0434 \u0434\u0440\u0443\u0433\u0438\u043c\u0438<\/a>, \u0441 \u0440\u044f\u0434\u043e\u043c \u043f\u043b\u044e\u0441\u043e\u0432 xml-\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0433\u043b\u0430\u0441\u0435\u043d.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0440\u0435\u0447\u044c \u043d\u0435 \u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u0445 \u043e\u0434\u043d\u0438\u0445 \u0438\u043b\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432 \u0434\u0440\u0443\u0433\u0438\u0445, \u0438 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u043d\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0430\u0433\u0438\u0442\u0430\u0446\u0438\u0438 \u0437\u0430 \u043d\u043e\u0432\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0438\u0448\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0442\u0447\u0435\u0442 \u043e \u0441\u0431\u043e\u0440\u043a\u0435 \u0432\u0435\u0431-\u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043d\u0443\u043b\u044f \u0434\u043e \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0418 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 embedded \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Jetty. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043a\u0430\u043a \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e Jetty, \u0442\u0430\u043a \u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432 Spring Application, MVC, Security, \u043d\u0430\u0432\u0430\u043b\u043e\u043c. \u041d\u043e \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u044f\u0445 \u044d\u0442\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u043d\u0435 \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0438 \u043d\u0435 \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u043a\u043e\u0441\u0442\u044b\u043b\u0438, \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043a\u043e\u0435-\u043a\u0430\u043a\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432. \u041d\u043e \u0434\u0430\u0436\u0435 \u0438\u043c\u0435\u044f \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u0440\u044f\u0434\u043e\u043c \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0435\u043d\u0438\u0439, \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438\u0448\u043b\u0430 \u0438\u0434\u0435\u044f \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435.<habracut text=\"\u0414\u0430\u043b\u0435\u0435 \u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u043a\u043e\u0434\u0430\"\/><\/p>\n<p>  \u0420\u0430\u043d\u044c\u0448\u0435 \u043c\u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0440\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0430\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u043d\u0430 standalone \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0435 (\u043e\u0431\u044b\u0447\u043d\u043e <i>Tomcat<\/i>), \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u044b \u0432\u0435\u0431-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b\u0438\u0441\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441\u043e \u0441\u0442\u0430\u0440\u0442\u043e\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0422\u0430\u043a\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0443\u0434\u043e\u0431\u043d\u0430 \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0430\u0447\u043a\u043e\u0439 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u0432\u043e\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440. \u041d\u043e \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u043a\u0440\u0443\u043f\u043d\u0435\u0435, \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u0435\u0435, \u0438 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u0442 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0442\u044c \u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0447\u0430\u0441\u0442\u043e \u0441\u0435\u0431\u044f \u043e\u043f\u0440\u0430\u0432\u0434\u044b\u0432\u0430\u0435\u0442. \u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438: \u0437\u0430\u043f\u0443\u0441\u043a \u0432 IDE \u043f\u0440\u043e\u0441\u0442, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0435\u0433\u043e \u0441\u0442\u0430\u0440\u0442 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f \u00ab\u0432 \u043e\u0434\u043d\u043e \u043a\u0430\u0441\u0430\u043d\u0438\u0435\u00bb. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u043e\u043f\u0440\u043e\u0441 \u0432\u0441\u0442\u0430\u043b \u043d\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0443, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u00ab\u0437\u0430\u0434\u0430\u0447\u043a\u0430 \u0440\u0430\u0434\u0438 \u0437\u0430\u0434\u0430\u0447\u043a\u0438\u00bb: \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0432\u0441\u0435\u0445 xml, \u0438\u043c\u0435\u0442\u044c \u00ab\u043d\u0430 \u0431\u043e\u0440\u0442\u0443\u00bb <i>embedded Jetty<\/i> \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0435\u0431-\u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 <i>Spring MVC<\/i> \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <i>Spring Security<\/i>.<\/p>\n<p>  \u0417\u0430\u0431\u0435\u0433\u0430\u044f \u0432\u043f\u0435\u0440\u0435\u0434, \u0441\u0440\u0430\u0437\u0443 \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e xml-\u0444\u0430\u0439\u043b\u0430, \u044f \u043d\u0435 \u0438\u0437\u0431\u0430\u0432\u0438\u043b\u0441\u044f \u043e\u0442 \u0432\u0441\u0435\u0445 xml-\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u2014 \u0437\u0432\u0443\u0447\u0438\u0442 \u043f\u0440\u043e\u0432\u043e\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u043e \u0438 \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e, \u043d\u043e \u044d\u0442\u043e \u0442\u0430\u043a: embedded Jetty \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 <i>org.eclipse.jetty.webapp<\/i> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0430\u0439\u043b <i>webdefault.xml<\/i>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u0442 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044f \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u044b <i>DefaultServlet<\/i> \u0438 <i>JspServlet<\/i>, \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u043b\u0438\u0441\u0442\u0435\u043d\u0435\u0440\u044b \u0438 \u044d\u043d\u043a\u043e\u0434\u0435\u0440\u044b \u2014 \u043e\u043a\u043e\u043b\u043e 500 \u0441\u0442\u0440\u043e\u043a xml-\u043a\u043e\u0434\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u044f \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0443\u0432\u0438\u0434\u0435\u043b \u0432 \u044d\u0442\u043e\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043e\u043a\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043e\u0439\u0442\u0438 \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0438\u043b\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0435\u0441\u0442\u044c, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441 \u043f\u0435\u0440\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 Jetty, Tomcat (<i>org.apache.catalina.startup.Tomcat.DefaultWebXmlListener<\/i> \u0434\u043b\u044f embedded \u0438\u043b\u0438 <i>${Catalina}\/conf\/web.xml<\/i> \u0434\u043b\u044f standalone), GlassFish (<i>${glassfish}\/domains\/domain1\/config\/default-web.xml<\/i>), JBoss (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Tomcat), Resin (<i>${resin}\/conf\/app-default.xml<\/i>), Jeronimo (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Tomcat) \u2014 \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043e\u0431\u044b\u0447\u043d\u0430 \u0434\u043b\u044f \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0438 \u0441\u043c\u044b\u0441\u043b\u0430 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0435\u0442. \u0425\u043e\u0442\u044f \u043e\u0442 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0445\u043e\u0442\u044f \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0438 \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0432\u0435\u043d\u043e\u0432\u0441\u043a\u0438\u0439 \u043f\u043b\u0430\u0433\u0438\u043d <i>maven-war-plugin<\/i> \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c <i>failOnMissingWebXml = false<\/i> \u043d\u0435\u0442.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0441\u0442\u0430\u0442\u044c\u044f \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u043a\u043e\u0434 \u0431\u044b\u043b\u0438 \u043f\u043e\u043b\u043d\u044b\u043c\u0438, \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0435\u043f\u0440\u043e\u0444\u0438\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, maven-\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f, jsp-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 &#8230;<\/p>\n<p>  \u0424\u0430\u0439\u043b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <b>pom.xml<\/b> (\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0430\u043f\u043e\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u2014 \u043f\u0440\u0438\u0432\u044b\u043a, \u043d\u0435 \u0445\u043e\u0442\u0435\u043b \u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e, \u0434\u0430\u043b\u0435\u0435 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0447\u0442\u0435\u043d\u0438\u044f), \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u043d\u0435 \u0441\u0442\u0430\u043b \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u2014 \u0442\u0435\u043c\u0430 \u0438\u0437\u0431\u0438\u0442\u0430\u044f \u0438 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043d\u044f\u0442\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">pom.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;project xmlns=&quot;http:\/\/maven.apache.org\/POM\/4.0.0&quot; xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/maven-v4_0_0.xsd&quot;&gt; \t&lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt; \t&lt;groupId&gt;com.idvsbruck&lt;\/groupId&gt; \t&lt;artifactId&gt;jetty-spring-test&lt;\/artifactId&gt; \t&lt;packaging&gt;war&lt;\/packaging&gt; \t&lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt; \t&lt;name&gt;test&lt;\/name&gt; \t&lt;description&gt;Embedded Jetty, Spring Java-based configuration&lt;\/description&gt;  \t&lt;developers&gt; \t\t&lt;developer&gt; \t\t\t&lt;id&gt;IDVsbruck&lt;\/id&gt; \t\t&lt;\/developer&gt; \t&lt;\/developers&gt;  \t&lt;properties&gt; \t\t&lt;out.name&gt;${project.artifactId}&lt;\/out.name&gt; \t\t&lt;out.folder&gt;out&lt;\/out.folder&gt; \t\t&lt;source.folder&gt;source&lt;\/source.folder&gt; \t\t&lt;resource.folder&gt;resource&lt;\/resource.folder&gt; \t\t&lt;spring.version&gt;4.1.6.RELEASE&lt;\/spring.version&gt; \t\t&lt;spring.security.version&gt;4.0.0.RELEASE&lt;\/spring.security.version&gt; \t\t&lt;jetty.version&gt;9.3.0.M1&lt;\/jetty.version&gt; \t&lt;\/properties&gt;  \t&lt;build&gt; \t\t&lt;finalName&gt;${out.name}&lt;\/finalName&gt; \t\t&lt;directory&gt;${out.folder}&lt;\/directory&gt; \t\t&lt;testOutputDirectory&gt;${out.folder}&lt;\/testOutputDirectory&gt; \t\t&lt;outputDirectory&gt;${out.folder}&lt;\/outputDirectory&gt; \t\t&lt;testSourceDirectory&gt;${source.folder}&lt;\/testSourceDirectory&gt; \t\t&lt;sourceDirectory&gt;${source.folder}&lt;\/sourceDirectory&gt;  \t\t&lt;resources&gt; \t\t\t&lt;resource&gt; \t\t\t\t&lt;directory&gt;${resource.folder}&lt;\/directory&gt; \t\t\t\t&lt;filtering&gt;true&lt;\/filtering&gt; \t\t\t&lt;\/resource&gt; \t\t&lt;\/resources&gt;  \t\t&lt;plugins&gt; \t\t\t&lt;plugin&gt; \t\t\t\t&lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt; \t\t\t\t&lt;artifactId&gt;maven-compiler-plugin&lt;\/artifactId&gt; \t\t\t\t&lt;version&gt;3.1&lt;\/version&gt; \t\t\t\t&lt;configuration&gt; \t\t\t\t\t&lt;source&gt;1.7&lt;\/source&gt; \t\t\t\t\t&lt;target&gt;1.7&lt;\/target&gt; \t\t\t\t&lt;\/configuration&gt; \t\t\t&lt;\/plugin&gt; \t\t&lt;\/plugins&gt; \t&lt;\/build&gt;  \t&lt;dependencies&gt; \t\t&lt;!-- Embedded Jetty server --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.eclipse.jetty&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;jetty-server&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${jetty.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- Web Application Context Handler --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.eclipse.jetty&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;jetty-webapp&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${jetty.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u043e\u0432, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 Jetty-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438 --&gt; \t\t&lt;!-- \u0414\u043b\u044f \u043f\u0440\u044f\u043c\u043e\u0433\u043e (\u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u043e\u0433\u043e) \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Jetty \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.eclipse.jetty&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;jetty-annotations&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${jetty.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432 Runtime \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 JSP, Jetty \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f JSP --&gt; \t\t&lt;!-- \u041f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 jsp-\u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.eclipse.jetty&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;jetty-jsp&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${jetty.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- Spring MVC \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.springframework&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;spring-webmvc&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${spring.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- Spring ORM \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.springframework&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;spring-orm&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${spring.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- Spring Security \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.springframework.security&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;spring-security-core&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${spring.security.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.springframework.security&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;spring-security-web&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${spring.security.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.springframework.security&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;spring-security-config&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${spring.security.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- \u041b\u043e\u0433\u0433\u0435\u0440 --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.slf4j&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;slf4j-log4j12&lt;\/artifactId&gt; \t\t\t&lt;version&gt;1.7.5&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- Hibernate ORM \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.hibernate&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;hibernate-core&lt;\/artifactId&gt; \t\t\t&lt;version&gt;4.3.8.Final&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- \u041d\u0430\u0431\u043e\u0440 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432 \u0438\u0437 org.hibernate.validator.constraints \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0438\u0437 javax.validation.constraints --&gt; \t\t&lt;!-- \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 - \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0448\u0438\u0431\u043e\u043a --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.hibernate&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;hibernate-validator&lt;\/artifactId&gt; \t\t\t&lt;version&gt;5.1.3.Final&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f DBCP \u043e\u0442 Apache --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.apache.commons&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;commons-dbcp2&lt;\/artifactId&gt; \t\t\t&lt;version&gt;2.0.1&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- \u041a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440 \u043a \u0411\u0414 MySQL (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u044d\u0442\u0443 \u0411\u0414) --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;mysql&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;mysql-connector-java&lt;\/artifactId&gt; \t\t\t&lt;version&gt;5.1.31&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- Spring Security \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043a\u043b\u0430\u0441\u0441\u044b \u0438\u0437 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u043e\u043b\u0435\u0432\u044b\u0445 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 jsr250 --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;javax.annotation&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;jsr250-api&lt;\/artifactId&gt; \t\t\t&lt;version&gt;1.0&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t&lt;\/dependencies&gt; &lt;\/project&gt; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <b>WEB-INF\/application.properties<\/b>:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">application.properties<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>base.url=\/test base.port=8080  database.url=jdbc:mysql:\/\/localhost:3306\/test database.user=root database.password=root  log4j.rootLogger=INFO, CONSOLE log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n  log4j.logger.org.hibernate=WARN log4j.logger.org.springframework=WARN log4j.logger.org.springframework.web=WARN log4j.logger.org.springframework.security=WARN log4j.logger.org.eclipse.jetty=WARN  log4j.logger.com.idvsbruck.test=DEBUG <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0411\u0430\u0437\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0430 \u0432\u0435\u0431-\u043f\u0440\u043e\u0435\u043a\u0442\u0430 <b>WEB-INF\/index.jsp<\/b>:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">index.jsp<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"html\">&lt;%@ page language=&quot;java&quot; contentType=&quot;text\/html; charset=UTF-8&quot; pageEncoding=&quot;UTF-8&quot; %&gt; &lt;!DOCTYPE html&gt; &lt;html&gt; \t&lt;head&gt; \t\t&lt;title&gt;Jetty-Spring :: Test&lt;\/title&gt; \t&lt;\/head&gt; \t&lt;body&gt; \t\t&lt;div&gt;Welcome!&lt;br\/&gt;Project context path: ${path}&lt;\/div&gt; \t&lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 <b>BaseController<\/b>:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">BaseController.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">@Controller public class BaseController {  \t@RequestMapping(value = &quot;\/**&quot;, method = RequestMethod.GET) \tpublic ModelAndView index(HttpSession session, HttpServletRequest request) { \t\tModelAndView result = new ModelAndView(&quot;index&quot;); \t\tresult.addObject(&quot;path&quot;, request.getContextPath()); \t\treturn result; \t} } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<ul>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e <i>Context Path<\/i> \u043d\u0430 \u043a\u043b\u0438\u0435\u0442\u0441\u043a\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0430\u0434\u0440\u0435\u0441 \u2014 <i>localhost:8080\/test<\/i>, \u0430 \u0434\u043b\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432, \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u044e\u0449\u0438\u0445 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e (\u043e\u0431\u044b\u0447\u043d\u043e \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f <i>HTML5 History API<\/i>) \u2014 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 <i>Routing<\/i>, \u043f\u0440\u0438 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043d\u0438\u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 (<i>routs<\/i>) \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441; \u0430 \u0442\u0430\u043a \u043a\u0430\u043a \u043a\u043b\u0438\u0435\u043d\u0442 \u0441\u0430\u043c \u043d\u0435 \u0434\u0435\u043b\u0438\u0442 <i>requestURI<\/i> \u043d\u0430 <i>contextPath<\/i> \u0438 <i>servletPath<\/i>, \u0442\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u0430\u0440\u043c\u043b\u0438\u0432\u0430\u0442\u044c \u0435\u043c\u0443 \u0435\u0433\u043e (\u0432 production \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e &quot;\/&quot;). Routing \u0435\u0441\u0442\u044c \u0432 <i>Backbone<\/i>, <i>Angular<\/i>, <i>Ember<\/i>, <i>React (\u043f\u043b\u0430\u0433\u0438\u043d\u044b)<\/i> \u0438 \u0442.\u0434. \u0421\u0435\u0439\u0447\u0430\u0441 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e React \u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0430\u043d\u043e\u043c\u0430\u043b\u0438\u044f\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0443\u0442\u0435\u0439. \u0410\u0434\u0440\u0435\u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <i>localhost:8080\/<\/i> \u043d\u0435 \u0432\u044b\u0437\u0432\u0430\u043b \u0431\u044b \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432.<\/li>\n<\/ul>\n<p>  <\/p>\n<ul>\n<li>\u0412\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u2014 <i>&quot;\/**&quot;<\/i>. \u041f\u0440\u0438 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043a \u0430\u0440\u0445\u0438\u0442\u0435\u0440\u0442\u0443\u0440\u0435 \u0432\u0435\u0431-\u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u0442\u0430\u043a\u043e\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u0431\u044b \u0430\u0431\u0441\u0443\u0440\u0434\u043d\u043e \u2014 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u043e \u0431\u044b \u043a \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443. \u041e\u0434\u043d\u0430\u043a\u043e, \u043a\u0430\u043a \u044f \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u0432\u044b\u0448\u0435, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044e, \u043d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u044f\u0441\u044c \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0437\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435\u0439 (\u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0435, <i>\u043e\u0434\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u043e\u0435 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u043c\u0435\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446<\/i>). \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u00ab\u043f\u0440\u043e\u0441\u0442\u043e\u0439\u00bb \u043c\u0430\u043f\u043f\u0438\u043d\u0433 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <i>{&quot;&quot;, &quot;\/&quot;, &quot;\/index&quot;}<\/i>): \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 <i>localhost:8080\/test\/<\/i>, \u0437\u0430\u0442\u0435\u043c \u043c\u0435\u043d\u044f\u0435\u0442 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u043d\u0430 <i>localhost:8080\/test\/about<\/i>, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435\u2026 \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430 <i>&quot;\/about&quot;<\/i> \u043d\u0435\u0442 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435, \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 <i>\u043e\u0448\u0438\u0431\u043a\u0443 404<\/i>. \u041f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0438 \u0432 \u0442\u0430\u043a\u043e\u043c \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u043b\u0438\u0431\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 (\u043d\u0443, \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0442\u0434\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e), \u043b\u0438\u0431\u043e \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u043e\u0434\u043d\u0438\u043c \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u043e\u043c. \u0422\u0430\u043a \u043a\u0430\u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u043f\u043f\u0438\u043d\u0433 \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0438\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043d\u0430\u0434 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c, \u043d\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u043e\u0432: \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 \u0441 \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u043e\u043c <i>&quot;\/about&quot;<\/i> \u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0442\u0438\u043f\u0430 <i>localhost:8080\/test\/about<\/i> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0441 <i>&quot;\/about&quot;<\/i>, \u0430 \u043d\u0435 <i>&quot;\/**&quot;<\/i> \u2014 \u044d\u0442\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <i>Spring MVC<\/i>, \u0433\u0434\u0435 \u0437\u0430 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u0434\u0430\u0447\u0443 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 <i>PathMatcher<\/i> \u2014 <i>org.springframework.util.AntPathMatcher<\/i>, \u043c\u0435\u0442\u043e\u0434 <i>combine(String pattern1, String pattern2)<\/i>. \u0425\u043e\u0442\u044f, \u043e\u043f\u044f\u0442\u044c-\u0442\u0430\u043a\u0438, \u0442\u0430\u043a\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0443\u0433\u043e\u0434\u0443 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u2014 \u044d\u0442\u043e \u0442\u0435\u043d\u0434\u0435\u043d\u0446\u0438\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043a\u043e\u0433\u0434\u0430 \u043b\u044c\u0432\u0438\u043d\u0443\u044e \u0434\u043e\u043b\u044e \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0445 MVC-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f \u043a\u043b\u0438\u0435\u043d\u0442. \u041a\u043e\u043c\u0443-\u0442\u043e \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f (\u044f \u0434\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u043b\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443), \u043a\u0442\u043e-\u0442\u043e \u0431\u0430\u0437\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0435\u0440\u0432\u0435\u0440 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u043a \u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u2014 \u043d\u0435 \u0445\u043e\u0447\u0443 \u043d\u0430\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u043b\u0438\u0431\u043e \u0442\u043e\u0447\u043a\u0443 \u0437\u0440\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0438 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0433\u043e \u00ab\u043f\u0440\u043e\u0433\u0438\u0431\u0430\u00bb \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u043e\u0434 \u043d\u0443\u0436\u0434\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<\/li>\n<\/ul>\n<p>  <\/p>\n<ul>\n<li>\u0422\u0440\u0435\u0442\u044c\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u2014 <i>application.properties<\/i>. \u0420\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043b\u043e\u0433\u0433\u0435\u0440\u0430 <i>log4j.properties<\/i> \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e <i>classpath<\/i>: \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 root \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u0432 pom.xml \u2014 \u043d\u0435\u0432\u0430\u0436\u043d\u043e, \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043e\u043d \u0431\u044b\u043b \u0432\u0438\u0434\u0435\u043d, \u0438\u043d\u0430\u0447\u0435 \u043f\u0440\u0438\u0439\u0434\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0441\u043e \u0441\u0442\u0430\u0440\u0442\u0430 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0433\u0440\u0443\u0441\u0442\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435:<br \/>\n<blockquote><p>log4j:WARN No appenders could be found for logger (org.eclipse.jetty.util.log).log4j:WARN Please initialize the log4j system properly.log4j:WARN See http:\/\/logging.apache.org\/log4j\/1.2\/faq.html#noconfig for more info.<\/p><\/blockquote>\n<p>\u0421\u0430\u043c \u0432\u043e\u043f\u0440\u043e\u0441 \u0432\u044b\u0435\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0439\u0446\u0430 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442, \u043d\u043e \u043d\u043e\u0432\u0438\u0447\u043a\u0438 \u043d\u0430 \u043d\u0435\u0433\u043e \u043d\u0430\u0442\u044b\u043a\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e. \u0421\u0434\u0435\u043b\u0430\u043b \u043f\u043e-\u0441\u0432\u043e\u0435\u043c\u0443: \u0432\u0441\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0432 <i>classpath<\/i>, \u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0438 \u0441\u043c\u044b\u0441\u043b \u043e\u0447\u0435\u043d\u044c \u0441\u043f\u043e\u0440\u043d\u044b, \u0441\u043a\u043e\u0440\u0435\u0435 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u043a\u0438.<\/li>\n<\/ul>\n<p>  <\/p>\n<h4>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432<\/h4>\n<p>  \u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2014 <b>ApplicationContext<\/b>:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ApplicationContext.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">@Configuration @ComponentScan(basePackages = &quot;com.idvsbruck.test&quot;) @PropertySource({&quot;WEB-INF\/application.properties&quot;}) public class ApplicationContext {  \t\/\/ \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 ConfigurableEnvironment \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \t\/\/ \u0434\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u043d\u0435\u043d\u0443\u0436\u043d\u043e\u0441\u0442\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0448\u0430\u0433\u0430 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u0442\u0430\u0440\u0442\u0430 embedded Jetty \u043d\u0430\u0440\u044f\u0434\u0443 \u0441 @PropertySource \t@Bean \tpublic static PropertySourcesPlaceholderConfigurer appProperty() { \t\treturn new PropertySourcesPlaceholderConfigurer(); \t}  \t\/\/ \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0444\u0430\u0439\u043b\u044b \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \t\/\/ \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0442\u0430\u043a\u043e\u0432\u044b\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u044d\u0442\u043e\u043c \u0431\u0438\u043d\u0435 \u043d\u0435\u0442 \t@Bean(name = &quot;messageSource&quot;) \tpublic MessageSource messageSource() { \t\tReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); \t\tmessageSource.setBasenames(&quot;WEB-INF\/i18n\/messages&quot;, &quot;WEB-INF\/i18n\/errors&quot;); \t\tmessageSource.setDefaultEncoding(&quot;UTF-8&quot;); \t\treturn messageSource; \t} } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 xml-\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">application.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;beans xmlns=&quot;http:\/\/www.springframework.org\/schema\/beans&quot; \txmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; \txmlns:context=&quot;http:\/\/www.springframework.org\/schema\/context&quot;  \txsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd \t\thttp:\/\/www.springframework.org\/schema\/context http:\/\/www.springframework.org\/schema\/context\/spring-context.xsd&quot;&gt;  \t&lt;context:property-placeholder location=&quot;\/WEB-INF\/application.properties&quot;\/&gt; \t&lt;context:annotation-config\/&gt; \t&lt;context:component-scan base-package=&quot;com.idvsbruck.test&quot;\/&gt;  \t&lt;bean id=&quot;messageSource&quot; class=&quot;org.springframework.context.support.ReloadableResourceBundleMessageSource&quot;&gt; \t\t&lt;property name=&quot;basenames&quot; value=&quot;\/WEB-INF\/i18n\/messages, \/WEB-INF\/i18n\/errors&quot;\/&gt; \t\t&lt;property name=&quot;defaultEncoding&quot; value=&quot;UTF-8&quot;\/&gt; \t&lt;\/bean&gt; &lt;\/beans&gt; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0421\u0443\u0431\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 <b>PersistenceContext<\/b>:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">PersistenceContext.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">@Configuration @EnableTransactionManagement public class PersistenceContext {  \t@Autowired \tprivate Environment environment;  \t@Bean(name = &quot;sessionFactory&quot;) \tpublic SessionFactory sessionFactory() throws IOException { \t\tfinal LocalSessionFactoryBean factory = new LocalSessionFactoryBean(); \t\tfactory.setDataSource(dataSource()); \t\tfactory.setHibernateProperties(hibernateProperties()); \t\tfactory.setPackagesToScan(&quot;com.idvsbruck.test.entity&quot;); \t\tfactory.afterPropertiesSet(); \t\treturn factory.getObject(); \t}  \t@Bean(name = &quot;dataSource&quot;) \tpublic DataSource dataSource() { \t\tfinal BasicDataSource dataSource = new BasicDataSource(); \t\tdataSource.setDriverClassName(&quot;com.mysql.jdbc.Driver&quot;); \t\tdataSource.setUrl(environment.getProperty(&quot;database.url&quot;)); \t\tdataSource.setUsername(environment.getProperty(&quot;database.user&quot;)); \t\tdataSource.setPassword(environment.getProperty(&quot;database.password&quot;)); \t\treturn dataSource; \t}  \t@Bean(name = &quot;transactionManager&quot;) \tpublic HibernateTransactionManager transactionManager() throws IOException { \t\treturn new HibernateTransactionManager(sessionFactory()); \t}  \tprivate static Properties hibernateProperties() { \t\tProperties hibernateProperties = new Properties(); \t\thibernateProperties.put(&quot;hibernate.dialect&quot;, &quot;org.hibernate.dialect.MySQLDialect&quot;); \t\thibernateProperties.put(&quot;hibernate.connection.autocommit&quot;, true); \t\thibernateProperties.put(&quot;hibernate.show_sql&quot;, false); \t\thibernateProperties.put(&quot;hibernate.format_sql&quot;, false); \t\thibernateProperties.put(&quot;hibernate.generate_statistics&quot;, false); \t\thibernateProperties.put(&quot;hibernate.hbm2ddl.auto&quot;, &quot;update&quot;); \t\thibernateProperties.put(&quot;hibernate.use_sql_comments&quot;, false); \t\thibernateProperties.put(&quot;hibernate.cache.use_query_cache&quot;, false); \t\thibernateProperties.put(&quot;hibernate.cache.use_second_level_cache&quot;, true); \t\treturn hibernateProperties; \t} } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 xml-\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 (\u043e\u0431\u044b\u0447\u043d\u043e \u0435\u0433\u043e \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0442 \u0432 \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\">application-persistence.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;beans xmlns=&quot;http:\/\/www.springframework.org\/schema\/beans&quot; \txmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; \txmlns:tx=&quot;http:\/\/www.springframework.org\/schema\/tx&quot; \txmlns:aop=&quot;http:\/\/www.springframework.org\/schema\/aop&quot;  \txsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd \t\thttp:\/\/www.springframework.org\/schema\/tx http:\/\/www.springframework.org\/schema\/tx\/spring-tx.xsd \t\thttp:\/\/www.springframework.org\/schema\/aop http:\/\/www.springframework.org\/schema\/aop\/spring-aop.xsd&quot;&gt;  \t&lt;bean id=&quot;dataSource&quot; class=&quot;org.apache.commons.dbcp2.BasicDataSource&quot; destroy-method=&quot;close&quot;&gt; \t\t&lt;property name=&quot;driverClassName&quot; value=&quot;com.mysql.jdbc.Driver&quot;\/&gt; \t\t&lt;property name=&quot;url&quot; value=&quot;${database.url}&quot;\/&gt; \t\t&lt;property name=&quot;username&quot; value=&quot;${database.user}&quot;\/&gt; \t\t&lt;property name=&quot;password&quot; value=&quot;${database.password}&quot;\/&gt; \t&lt;\/bean&gt;  \t&lt;bean id=&quot;sessionFactory&quot; class=&quot;org.springframework.orm.hibernate4.LocalSessionFactoryBean&quot;&gt; \t\t&lt;property name=&quot;dataSource&quot; ref=&quot;dataSource&quot;\/&gt; \t\t&lt;property name=&quot;hibernateProperties&quot;&gt; \t\t\t&lt;props&gt; \t\t\t\t&lt;prop key=&quot;hibernate.dialect&quot;&gt;org.hibernate.dialect.MySQLDialect&lt;\/prop&gt; \t\t\t\t&lt;prop key=&quot;hibernate.connection.autocommit&quot;&gt;true&lt;\/prop&gt; \t\t\t\t&lt;prop key=&quot;hibernate.show_sql&quot;&gt;false&lt;\/prop&gt; \t\t\t\t&lt;prop key=&quot;hibernate.format_sql&quot;&gt;false&lt;\/prop&gt; \t\t\t\t&lt;prop key=&quot;hibernate.generate_statistics&quot;&gt;false&lt;\/prop&gt; \t\t\t\t&lt;prop key=&quot;hibernate.hbm2ddl.auto&quot;&gt;update&lt;\/prop&gt; \t\t\t\t&lt;prop key=&quot;hibernate.use_sql_comments&quot;&gt;false&lt;\/prop&gt; \t\t\t\t&lt;prop key=&quot;hibernate.cache.use_query_cache&quot;&gt;false&lt;\/prop&gt; \t\t\t\t&lt;prop key=&quot;hibernate.cache.use_second_level_cache&quot;&gt;true&lt;\/prop&gt; \t\t\t&lt;\/props&gt; \t\t&lt;\/property&gt; \t\t&lt;property name=&quot;packagesToScan&quot; value=&quot;com.idvsbruck.test.entity&quot;\/&gt; \t&lt;\/bean&gt;  \t&lt;bean id=&quot;transactionManager&quot; class=&quot;org.springframework.orm.hibernate4.HibernateTransactionManager&quot;&gt; \t\t&lt;property name=&quot;sessionFactory&quot; ref=&quot;sessionFactory&quot;\/&gt; \t&lt;\/bean&gt;  \t&lt;tx:annotation-driven transaction-manager=&quot;transactionManager&quot;\/&gt; &lt;\/beans&gt; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u0430 (Spring MVC context) <b>WebContext<\/b>:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">WebContext.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">@EnableWebMvc @Configuration public class WebContext extends WebMvcConfigurerAdapter {  \t@Autowired \tprivate MessageSource messageSource;  \t@Autowired \tprivate SessionFactory sessionFactory;  \t\/\/ \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 order \u0432 -1 \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u0430, \t\/\/ \u0438\u043d\u0430\u0447\u0435 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0442\u0430\u043a\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0441 \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u043e\u043c &quot;\/**&quot; \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0435\u0440\u0435\u043a\u0430\u044e\u0449\u0438\u043c\u0438\u0441\u044f \t@Override \tpublic void addResourceHandlers(ResourceHandlerRegistry registry) { \t\tregistry.addResourceHandler(&quot;\/javascript\/share\/**&quot;).addResourceLocations(&quot;\/javascript\/share\/&quot;); \t\tregistry.setOrder(-1); \t}  \t\/\/ \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 resolver \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439, \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u0435\u043d, \u043d\u0430\u0434\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043d\u0435\u0442 \t\/\/ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 InternalResourceViewResolver, \u043d\u043e \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 UrlBasedViewResolver \u043d\u0435 \u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043e \t\/\/ \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 JstlView \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c JSTL-\u0438\u043d\u044a\u0435\u043a\u0446\u0438\u0438 \u0432 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438\u043b\u0438 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \t@Bean \tpublic ViewResolver viewResolver(){ \t\tInternalResourceViewResolver resolver = new InternalResourceViewResolver(); \t\tresolver.setPrefix(&quot;\/WEB-INF\/views\/&quot;); \t\tresolver.setSuffix(&quot;.jsp&quot;); \t\tresolver.setViewClass(JstlView.class); \t\treturn resolver; \t}  \t\/\/ \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u043b\u0435\u0442 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430, \t\/\/ \u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \t@Override \tpublic void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { \t\tconfigurer.enable(); \t}  \t\/\/ \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \t@Bean(name = &quot;validator&quot;) \tpublic LocalValidatorFactoryBean validator() { \t\tLocalValidatorFactoryBean validatorFactoryBean = new LocalValidatorFactoryBean(); \t\tvalidatorFactoryBean.setValidationMessageSource(messageSource); \t\treturn validatorFactoryBean; \t}  \t\/\/ \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430 \u0432 \u0446\u0435\u043f\u043e\u0447\u043a\u0435 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432 Spring MVC \t@Override \tpublic Validator getValidator() { \t\treturn validator(); \t}  \t\/\/ \u0431\u0438\u043d \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0449\u0438\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043b\u043e\u043a\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 (\u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \t\/\/ \u0438 \u0447\u0438\u0442\u0430\u0435\u0442 \u043a\u0443\u043a\u0443 \u0441 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0439 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u044e) \t@Bean \tpublic CookieLocaleResolver localeResolver() { \t\tCookieLocaleResolver localeResolver = new CookieLocaleResolver(); \t\tlocaleResolver.setDefaultLocale(Locale.forLanguageTag(&quot;en&quot;)); \t\treturn localeResolver; \t}  \t\/\/ \u043d\u0430\u0431\u043e\u0440 \u0438\u043d\u0442\u0435\u0440\u0446\u0435\u043f\u0442\u0435\u0440\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 - \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u0441\u043e\u0432\u0441\u0435\u043c \u0438\u043b\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0441\u0432\u043e\u0438\u043c\u0438 \t@Override \tpublic void addInterceptors(InterceptorRegistry registry) { \t\t\/\/ \u0438\u043d\u0442\u0435\u0440\u0446\u0435\u043f\u0442\u043e\u0440 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043b\u043e\u043a\u0430\u043b\u0438 \u043f\u0440\u0438 \u0435\u0435 \u0441\u043c\u0435\u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \t\tLocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor(); \t\tlocaleChangeInterceptor.setParamName(&quot;language&quot;); \t\tregistry.addInterceptor(localeChangeInterceptor); \t\t\/\/ \u043e\u0431\u044b\u0447\u043d\u044b\u0439 OSIV \u0438\u043d\u0442\u0435\u0440\u0446\u0435\u043f\u0442\u043e\u0440 \t\tOpenSessionInViewInterceptor openSessionInViewInterceptor = new OpenSessionInViewInterceptor(); \t\topenSessionInViewInterceptor.setSessionFactory(sessionFactory); \t\tregistry.addWebRequestInterceptor(openSessionInViewInterceptor); \t\t\/\/ \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0446\u0435\u043f\u0442\u043e\u0440 \u0434\u043b\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \t\tApiInterceptor apiInterceptor = new ApiInterceptor(); \t\tregistry.addInterceptor(apiInterceptor).addPathPatterns(&quot;\/api\/**&quot;); \t} } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <i>WebMvcConfigurerAdapter<\/i> \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u043d\u0430\u0431\u043e\u0440 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u043e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 <i>WebMvcConfigurationSupport<\/i>, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 <i>AbstractAnnotationConfigDispatcherServletInitializer<\/i>, \u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043d\u0430 \u0431\u0438\u043d\u0430\u0445, \u0434\u0435\u043b\u0430\u044f \u043c\u043d\u043e\u0433\u043e \u043d\u0435\u043d\u0443\u0436\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 xml-\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">springmvc-servlet.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;beans xmlns=&quot;http:\/\/www.springframework.org\/schema\/beans&quot; \txmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; \txmlns:mvc=&quot;http:\/\/www.springframework.org\/schema\/mvc&quot; \txsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd \t\thttp:\/\/www.springframework.org\/schema\/mvc http:\/\/www.springframework.org\/schema\/mvc\/spring-mvc.xsd&quot;&gt;  \t&lt;mvc:resources mapping=&quot;\/javascript\/share\/**&quot; location=&quot;\/javascript\/share\/&quot; order=&quot;-1&quot;\/&gt;  \t&lt;mvc:default-servlet-handler\/&gt;  \t&lt;mvc:annotation-driven validator=&quot;validator&quot;\/&gt;  \t&lt;bean id=&quot;viewResolver&quot; class=&quot;org.springframework.web.servlet.view.InternalResourceViewResolver&quot;&gt; \t\t&lt;property name=&quot;viewClass&quot; value=&quot;org.springframework.web.servlet.view.JstlView&quot;\/&gt; \t\t&lt;property name=&quot;prefix&quot; value=&quot;\/WEB-INF\/views\/&quot;\/&gt; \t\t&lt;property name=&quot;suffix&quot; value=&quot;.jsp&quot;\/&gt; \t&lt;\/bean&gt;  \t&lt;mvc:interceptors&gt; \t\t&lt;bean class=&quot;org.springframework.orm.hibernate4.support.OpenSessionInViewInterceptor&quot;&gt; \t\t\t&lt;property name=&quot;sessionFactory&quot; ref=&quot;sessionFactory&quot;\/&gt; \t\t&lt;\/bean&gt; \t\t&lt;bean class=&quot;org.springframework.web.servlet.i18n.LocaleChangeInterceptor&quot;&gt; \t\t\t&lt;property name=&quot;paramName&quot; value=&quot;language&quot;\/&gt; \t\t&lt;\/bean&gt; \t\t&lt;mvc:interceptor&gt; \t\t\t&lt;mvc:mapping path=&quot;\/api\/**&quot;\/&gt; \t\t\t&lt;bean class=&quot;com.idvsbruck.test.common.ApiInterceptor&quot;\/&gt; \t\t&lt;\/mvc:interceptor&gt; \t&lt;\/mvc:interceptors&gt;  \t&lt;bean id=&quot;localeResolver&quot; class=&quot;org.springframework.web.servlet.i18n.CookieLocaleResolver&quot;&gt; \t\t&lt;property name=&quot;defaultLocale&quot; value=&quot;en&quot;\/&gt; \t&lt;\/bean&gt; &lt;\/beans&gt; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 <i>Spring Security<\/i> <b>SecutityContext<\/b>. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u043c\u0438 \u0437\u0430\u0449\u0438\u0442\u044b, \u0440\u043e\u043b\u0435\u0432\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0442.\u0434. \u2014 \u0432\u0441\u0435\u0433\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a <i>Spring Security<\/i>. \u041e\u0434\u043d\u0430\u043a\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043d\u0435\u043f\u043e\u043b\u043d\u043e\u0439, \u0435\u0441\u043b\u0438 \u043e\u0431\u043e\u0439\u0442\u0438 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 <i>Spring Security<\/i>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d, \u043d\u043e \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0444\u0440\u0435\u0439\u043c\u043e\u0440\u043a\u043e\u043c \u0438 \u043d\u044e\u0430\u043d\u0441\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0441 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">SecurityContext.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">@Configuration \/\/ \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 debug=true, \u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 - \u043f\u043e\u0442\u043e\u043a \u043b\u043e\u0433\u043e\u0432 \u0437\u0430\u0448\u043a\u0430\u043b\u0438\u0432\u0430\u0435\u0442 @EnableWebSecurity @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true, jsr250Enabled = true) public class SecurityContext extends WebSecurityConfigurerAdapter {  \t\/\/ \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f web based security \u0434\u043b\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 http-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \t@Override \tprotected void configure(HttpSecurity http) throws Exception { \t\thttp.authorizeRequests().antMatchers(&quot;\/**&quot;).permitAll(); \t\thttp.formLogin().loginPage(&quot;\/signin&quot;); \t\thttp.logout().invalidateHttpSession(true).logoutSuccessUrl(&quot;\/&quot;).logoutUrl(&quot;\/signout&quot;); \t\thttp.anonymous().authorities(&quot;USER_ANONYMOUS&quot;).principal(&quot;guest&quot;).key(&quot;foobar&quot;); \t}  \t\/\/ \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \t@Override \tpublic void configure(WebSecurity web) { \t\tweb.ignoring().antMatchers(&quot;\/javascript\/share\/**&quot;); \t}  \t\/\/ \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 (\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u0430\u044f - InMemory, \u0438\u043b\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u043e\u043a\u0435\u043d\u043e\u0432, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u0441 \u0411\u0414 \u0438 \u0442.\u0434. \t\/\/ \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \t@Override \tprotected void configure(AuthenticationManagerBuilder auth) throws Exception { \t\tauth.authenticationProvider(authenticationProvider()); \t}  \t\/\/ \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u0430, \u0431\u0435\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u0432\u044b\u043b\u0435\u0442\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435; \u0431\u0430\u0437\u043e\u0432\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \t@Bean \t@Override \tpublic AuthenticationManager authenticationManager() throws Exception { \t\treturn super.authenticationManager(); \t}  \t\/\/ \u0431\u0438\u043d \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \t@Bean(name = &quot;authenticationProvider&quot;) \tpublic AuthenticationProvider authenticationProvider() { \t\treturn new CustomAuthenticationProvider(); \t}  \t\/\/ \u0431\u0438\u043d \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u043e\u0433\u043e UserDetailsService \t@Bean(name = &quot;userDetailsService&quot;) \tpublic UserDetailsService userDetailsService() { \t\treturn new CustomUserDetailsManager(); \t}  \t\/\/ \u043a\u043e\u0434\u0435\u0440 \u0434\u043b\u044f \u043f\u0430\u0440\u043e\u043b\u0435\u0439; \u043d\u0430 \u0441\u043c\u0435\u043d\u0443 deprecated org.springframework.security.authentication.encoding.PasswordEncoder \t\/\/ \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 org.springframework.security.crypto.password.PasswordEncoder \t\/\/ \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c BCryptPasswordEncoder \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0445\u0435\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 BCrypt, \u0438\u043b\u0438 StandartPasswordEncoder, \u0431\u0430\u0437\u0438\u0440\u0443\u044e\u0449\u0438\u0439\u0441\u044f \t\/\/ \u043d\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 SHA-256 \u0438\u043b\u0438 NoOpPasswordEncoder \u0431\u0435\u0437 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u044f (\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0444\u0430\u0437\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438) \t@Bean(name = &quot;passwordEncoder&quot;) \tpublic PasswordEncoder passwordEncoder() { \t\treturn new BCryptPasswordEncoder(); \t} } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 xml-\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">application-security.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;beans xmlns=&quot;http:\/\/www.springframework.org\/schema\/beans&quot; \txmlns:security=&quot;http:\/\/www.springframework.org\/schema\/security&quot; \txmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; \txsi:schemaLocation=&quot;http:\/\/www.springframework.org\/schema\/beans http:\/\/www.springframework.org\/schema\/beans\/spring-beans.xsd \t\thttp:\/\/www.springframework.org\/schema\/security http:\/\/www.springframework.org\/schema\/security\/spring-security.xsd&quot;&gt;  \t&lt;security:http pattern=&quot;\/javascript\/share\/**&quot; security=&quot;none&quot;\/&gt;  \t&lt;security:global-method-security secured-annotations=&quot;enabled&quot; jsr250-annotations=&quot;enabled&quot; pre-post-annotations=&quot;enabled&quot;\/&gt;  \t&lt;security:http auto-config=&quot;false&quot; use-expressions=&quot;true&quot; disable-url-rewriting=&quot;true&quot; entry-point-ref=&quot;authEntryPoint&quot;&gt; \t\t&lt;security:intercept-url pattern=&quot;\/**&quot; access=&quot;permitAll&quot;\/&gt; \t\t&lt;security:form-login login-page=&quot;\/signin&quot;\/&gt; \t\t&lt;security:logout invalidate-session=&quot;true&quot; logout-success-url=&quot;\/&quot; logout-url=&quot;\/signout&quot;\/&gt; \t\t&lt;security:anonymous enabled=&quot;true&quot; username=&quot;guest&quot; granted-authority=&quot;USER_ANONYMOUS&quot; key=&quot;foobar&quot;\/&gt; \t&lt;\/security:http&gt; \t \t&lt;security:authentication-manager alias=&quot;authenticationManager&quot;&gt; \t\t&lt;security:authentication-provider ref=&quot;customAuthenticationProvider&quot;\/&gt; \t&lt;\/security:authentication-manager&gt;  \t&lt;bean id=&quot;customAuthenticationProvider&quot; class=&quot;com.idvsbruck.test.security.CustomAuthenticationProvider&quot;&gt; \t\t&lt;property name=&quot;userDetailsService&quot; ref=&quot;userDetailsService&quot;\/&gt; \t&lt;\/bean&gt;  \t&lt;bean id=&quot;userDetailsService&quot; class=&quot;com.idvsbruck.test.security.CustomUserDetailsManager&quot;\/&gt;  \t&lt;bean id=&quot;passwordEncoder&quot; class=&quot;org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder&quot;\/&gt; &lt;\/beans&gt; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h4>\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f embedded Jetty \u0441\u0435\u0440\u0432\u0435\u0440\u0430<\/h4>\n<p>  \u0421\u0445\u0435\u043c\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430: \u043d\u0430\u0434\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u0435\u0431-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u044b, \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u0442\u0430\u0440\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0435\u0433\u043e \u0437\u0430 \u0432\u0435\u0431-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 (\u0434\u043b\u044f Jetty \u044d\u0442\u043e <i>WebAppContext<\/i>), \u043e\u043d \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0434\u043b\u044f Java \u0432\u0435\u0431 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043f\u0430\u043f\u043a\u0435 <i>WEB-INF<\/i>, \u0433\u0434\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f <i>web.xml<\/i>, \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0432\u0435\u0431-\u043f\u0440\u043e\u0435\u043a\u0442: \u0442\u0435 \u0436\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b, \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u044b, \u043b\u0438\u0441\u0442\u0435\u043d\u0435\u0440\u044b, \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0441\u0435\u043a\u044a\u044e\u0440\u0438\u0442\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438 \u0442.\u0434. \u0422\u0430\u043a \u043a\u0430\u043a \u0446\u0435\u043b\u044c\u044e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043a\u0430\u0437 \u043e\u0442 xml-\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f <i>web.xml<\/i>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c, \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u044d\u0442\u043e \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 (\u0442\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438):<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Main.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">public class Main {  \tpublic static void main(String... args) throws Exception { \t\tProperties properties = new Properties(); \t\t\/\/ \u0447\u0438\u0442\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0438\u043f\u0430 Properties \t\tInputStream stream = Main.class.getResourceAsStream(&quot;\/WEB-INF\/application.properties&quot;); \t\tproperties.load(stream); \t\tstream.close(); \t\t\/\/ \u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043b\u043e\u0433\u0433\u0435\u0440\u0443 log4j \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \t\tPropertyConfigurator.configure(properties);  \t\t\/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0432\u0435\u0431-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043d\u0430 \u0431\u0430\u0437\u0435 \u043d\u0430\u0448\u0435\u0439 Java-based \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 WebContext \t\tAnnotationConfigWebApplicationContext webContext = new AnnotationConfigWebApplicationContext(); \t\twebContext.register(WebContext.class); \t\t\/\/ \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \t\twebContext.getEnvironment().getPropertySources().addLast(new PropertiesPropertySource(&quot;applicationEnvironment&quot;, properties));  \t\t\/\/ \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u043b\u0435\u0442 Spring MVC \t\tServletHolder servletHolder = new ServletHolder(&quot;test-dispatcher&quot;, new DispatcherServlet(webContext)); \t\tservletHolder.setAsyncSupported(true); \t\tservletHolder.setInitOrder(1);  \t\t\/\/ \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440 Spring Security \t\tFilterHolder filterHolder = new FilterHolder(new DelegatingFilterProxy(&quot;springSecurityFilterChain&quot;)); \t\tfilterHolder.setAsyncSupported(true);  \t\t\/\/ \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0432\u0435\u0431-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 Jetty \t\tWebAppContext webAppContext = new WebAppContext(); \t\t\/\/ \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \t\twebAppContext.setInitParameter(&quot;contextConfigLocation&quot;, ApplicationContext.class.getName()); \t\t\/\/ \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u043f\u0430\u043f\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f WEB-INF \t\twebAppContext.setResourceBase(&quot;resource&quot;); \t\t\/\/ \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f, Context Path, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u043b\u0435\u0442 \u0438 \u0444\u0438\u043b\u044c\u0442\u0440 \t\twebAppContext.addEventListener(new ContextLoaderListener(webContext)); \t\twebAppContext.setContextPath(properties.getProperty(&quot;base.url&quot;)); \t\twebAppContext.addServlet(servletHolder, &quot;\/&quot;); \t\twebAppContext.addFilter(filterHolder, &quot;\/*&quot;, EnumSet.of(DispatcherType.REQUEST, DispatcherType.ERROR));  \t\t\/\/ \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \t\tServer server = new Server(Integer.parseInt(properties.getProperty(&quot;base.port&quot;))); \t\tserver.setHandler(webAppContext); \t\tserver.start(); \t\tserver.join(); \t} } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 (<i>Environment<\/i>) \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 (\u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f <i>@PropertySource<\/i> \u0438 \u0431\u0438\u043d <i>PropertySourcesPlaceholderConfigurer appProperty()<\/i>) \u2014 \u044d\u0442\u043e \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434. \u0422\u0430\u043a\u0436\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0433\u0434\u0435 \u0431\u044b \u0442\u043e \u043d\u0438 \u0431\u044b\u043b\u043e \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0430 \u0441 \u043d\u0435\u0439 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <i>@ Value<\/i> \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438\u0437 \u044d\u0442\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u2014 \u0441\u0442\u043e\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c <i>@ Autowired private Environment env<\/i>, \u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u041b\u0438\u0447\u043d\u043e \u044f \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u044d\u0442\u043e\u0439 \u0438\u043d\u043d\u043e\u0432\u0430\u0446\u0438\u0435\u0439 (?), \u0438 \u043c\u043d\u0435 \u043e\u043d\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0447\u0440\u0435\u0437\u0432\u044b\u0447\u0430\u0439\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e\u0439.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u044b \u0438\u043b\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u044b \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f <i>@ComponentScan<\/i> \u0432 <i>ApplicationContext<\/i> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u0443 \u043d\u0430 \u043f\u0430\u043a\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 Spring. \u0421\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044f\u0441\u044c \u0441 <i>@ Configuration<\/i>, Spring \u0441\u0430\u043c \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u0422\u0443\u0442, \u043a\u0441\u0442\u0430\u0442\u0438, \u043d\u0435\u043b\u044c\u0437\u044f \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u00ab\u0432\u0441\u0435\u044f\u0434\u043d\u043e\u0441\u0442\u044c\u00bb Spring \u2014 \u0441\u043a\u0430\u0440\u043c\u043b\u0438\u0432\u0430\u044f \u0432 \u043b\u044e\u0431\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u044b \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432, \u043e\u043d \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044b\u0441\u0442\u0440\u043e\u0438\u0442 \u043d\u0443\u0436\u043d\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u044f, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0440\u044f\u0434\u0443 \u0441 <i>@ComponentScan<\/i> \u0443\u043a\u0430\u0437\u0430\u0442\u044c <i>@ Import<\/i> \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u0430 \u2014 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0434\u0432\u0430\u0436\u0434\u044b, \u044d\u0442\u043e \u0432\u0438\u0434\u043d\u043e \u043f\u043e \u043b\u043e\u0433\u0430\u043c). \u0412 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Jetty \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u0430\u043c\u0438 <i>WebContext<\/i> \u0438 <i>ApplicationContext<\/i>, \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u0442 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  \u0412\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Jetty \u2014 \u044d\u0442\u043e \u043f\u043e\u0439\u0442\u0438 \u043f\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432 Spring \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <i>WebApplicationInitializer<\/i>. \u0412 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Spring \u043e\u0431\u044b\u0447\u043d\u043e \u0442\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442 Spring \u2014 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <i>onStartup<\/i> \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 <i>AbstractSecurityWebApplicationInitializer<\/i>. Jetty \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c-\u0444\u0430\u0431\u0440\u0438\u043a\u0443, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0443\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u044b \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u0430\u0441\u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Jetty \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Main.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>public class Main {  \tpublic static void main(String... args) throws Exception { \t\tProperties properties = new Properties(); \t\tInputStream stream = Main.class.getResourceAsStream(&quot;\/WEB-INF\/application.properties&quot;); \t\tproperties.load(stream); \t\tstream.close(); \t\tPropertyConfigurator.configure(properties);  \t\tWebAppContext webAppContext = new WebAppContext(); \t\twebAppContext.setResourceBase(&quot;resource&quot;); \t\twebAppContext.setContextPath(properties.getProperty(&quot;base.url&quot;)); \t\twebAppContext.setConfigurations(new Configuration[] { \t\t\tnew WebXmlConfiguration(), \t\t\tnew AnnotationConfiguration() { \t\t\t\t@Override \t\t\t\tpublic void preConfigure(WebAppContext context) { \t\t\t\t\tClassInheritanceMap map = new ClassInheritanceMap(); \t\t\t\t\tmap.put(WebApplicationInitializer.class.getName(), new ConcurrentHashSet&lt;String&gt;() {{ \t\t\t\t\t\tadd(WebInitializer.class.getName()); \t\t\t\t\t\tadd(SecurityWebInitializer.class.getName()); \t\t\t\t\t}}); \t\t\t\t\tcontext.setAttribute(CLASS_INHERITANCE_MAP, map); \t\t\t\t\t_classInheritanceHandler = new ClassInheritanceHandler(map); \t\t\t\t} \t\t\t} \t\t});  \t\tServer server = new Server(Integer.parseInt(properties.getProperty(&quot;base.port&quot;))); \t\tserver.setHandler(webAppContext); \t\tserver.start(); \t\tserver.join(); \t} } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0422\u0430\u043a\u043e\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u0435\u0439, \u0445\u043e\u0442\u044f \u0438 \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u0422\u0430\u043a \u043a\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u0432 \u0442\u0430\u043a\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0433\u0440\u0430\u043d\u0438\u0446 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0432\u0441\u044f \u044d\u0442\u0430 \u0447\u0435\u0445\u0430\u0440\u0434\u0430 \u0441 \u0440\u0443\u0447\u043d\u044b\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043b\u0438\u0448\u043d\u0435\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u0434\u043e \u043b\u0438\u0431\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0445 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443, \u0433\u0434\u0435 \u0443\u0436\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e (\u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0438 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u044c), \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c <i>@PropertySource<\/i>, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435.<br \/>  \u0411\u0435\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f <i>new WebXmlConfiguration()<\/i> Jetty \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043e \u0447\u0435\u043c \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438: \u0432 \u044d\u0442\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 <i>webdefault.xml<\/i> \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 jetty \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u043e\u0432, \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 \u0438 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043e\u043a.<br \/>  \u041f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <i>preConfigure<\/i> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u043d\u0430 \u043a\u043b\u0430\u0441\u0441 <b>SecurityWebInitilizer<\/b>:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">SecurityWebInitializer.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">public class SecurityWebInitializer extends AbstractSecurityWebApplicationInitializer { } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0412\u0441\u0435. \u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u2014 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 <i>DelegatingFilterProxy<\/i> \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <i>\u00abspringSecurityFilterChain\u00bb<\/i>. \u042d\u0442\u043e \u043f\u0440\u044f\u043c\u043e\u0439 \u0430\u043d\u0430\u043b\u043e\u0433 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0438\u0437 <i>web.xml<\/i>:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">web.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">... \t&lt;filter&gt; \t\t&lt;filter-name&gt;springSecurityFilterChain&lt;\/filter-name&gt; \t\t&lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;\/filter-class&gt; \t\t&lt;async-supported&gt;true&lt;\/async-supported&gt; \t&lt;\/filter&gt; \t&lt;filter-mapping&gt; \t\t&lt;filter-name&gt;springSecurityFilterChain&lt;\/filter-name&gt; \t\t&lt;url-pattern&gt;\/*&lt;\/url-pattern&gt; \t\t&lt;dispatcher&gt;REQUEST&lt;\/dispatcher&gt; \t\t&lt;dispatcher&gt;ERROR&lt;\/dispatcher&gt; \t&lt;\/filter-mapping&gt; ... <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0421\u0430\u043c <i>AbstractSecurityWebApplicationInitializer<\/i> \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <i>WebApplicationInitializer<\/i>, \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 <i>onStartup<\/i> \u043a\u0430\u043a <i>final<\/i>, \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u0435\u0449\u0430\u0435\u0442 \u043d\u0430\u043c \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c. \u0417\u0430\u0447\u0435\u043c \u0442\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u043d\u043e, \u043c\u043d\u0435 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e: \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0435\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u043e\u043c\u0438\u043c\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u043e\u0434\u043d\u043e\u0431\u043e\u043a\u043e\u0433\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0438\u043c\u0435\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0434\u043b\u044f <i>Spring MVC<\/i>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043e\u0442 <i>Spring Security<\/i>, \u043d\u043e \u0432\u0438\u0434\u0438\u043c\u043e, Spring \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0442\u0430\u043a\u043e\u0439 \u0432\u044b\u0431\u043e\u0440 \u2014 \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439 2 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445, \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0439 \u0432 MVC&#8217;\u0448\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440 \u0444\u0438\u043b\u044c\u0442\u0440 \u0434\u043b\u044f Security (\u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u043e\u0439). \u0425\u043e\u0442\u044f <i>SecurityWebInitializer<\/i> \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u00ab\u0447\u0438\u0441\u0442\u043e\u0433\u043e\u00bb \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u2026 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0435 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 <i>WebInitializer<\/i>.<\/p>\n<p>  \u0421\u0430\u043c <b>WebInitializer<\/b>:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">WebInitializer.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">public class WebInitializer extends AbstractSecurityWebApplicationInitializer {  \t@Override \tpublic void onStartup(ServletContext servletContext) { \t\tAnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext(); \t\tapplicationContext.register(ApplicationContext.class); \t\tservletContext.addListener(new ContextLoaderListener(applicationContext)); \t\tServletRegistration.Dynamic dispatcher = servletContext.addServlet(&quot;test-dispatcher&quot;, new DispatcherServlet(applicationContext)); \t\tdispatcher.setLoadOnStartup(1); \t\tdispatcher.setAsyncSupported(true); \t\tdispatcher.addMapping(&quot;\/&quot;); \t} } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e, \u0432\u0438\u0434\u0438\u043c\u043e, \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044f\u043c \u0442\u0430\u043a\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430, \u0432\u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0432 Spring MVC 3.1, \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e, \u0438 \u0443\u0436\u0435 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 3.2 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 <i>AbstractAnnotationConfigDispatcherServletInitializer<\/i>, \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u044e\u0449\u0438\u0439 \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0435\u0433\u043e, \u043d\u0430\u0448 <i>WebInitializer<\/i> \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">WebInitializer.java<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"java\">public class WebInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {  \t@Override \tprotected Class&lt;?&gt;[] getRootConfigClasses() { \t\treturn new Class&lt;?&gt;[] {ApplicationContext.class}; \t}  \t@Override \tprotected Class&lt;?&gt;[] getServletConfigClasses() { \t\treturn null; \t}  \t@Override \tprotected String[] getServletMappings() { \t\treturn new String[] {&quot;\/&quot;}; \t}  \t@Override \tprotected String getServletName() { \t\treturn &quot;test-dispatcher&quot;; \t} } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0412\u0441\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u0438 \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u043e\u0432 \u044d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u0431\u0435\u0440\u0435\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f.<\/p>\n<p>  \u0412\u043e\u0442, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0432\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 <i>embedded Jetty + Spring MVC + Spring Security<\/i>. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441 <i>Main<\/i>, \u0442\u0435\u0441\u0442\u043e\u0432\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <i>localhost:8080\/test<\/i>.     \t<\/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\/255773\/\"> http:\/\/habrahabr.ru\/post\/255773\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t<habracut\/>\u041a\u043e\u043c\u0443-\u0442\u043e \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e xml-\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0435\u0441\u043b\u0438 \u043d\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435, \u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0442\u043e\u0447\u043d\u043e, \u043a\u043e\u043c\u0443-\u0442\u043e \u043d\u0435\u0442. \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u044f \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0430 <i>persistence.xml<\/i> \u0443\u0448\u043b\u0438 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u2014 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0414\u0411 \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439, \u0430 \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432. \u0412\u044b\u0432\u043e\u0434 \u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d: \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0435 \u0441\u0442\u0440\u0430\u0434\u0430\u0435\u0442 \u0430\u043d\u0430\u0445\u0440\u043e\u043d\u0438\u0437\u043c\u043e\u043c, \u0442\u043e \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u0443\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u2014 \u0447\u0430\u0441\u0442\u044c \u0432 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u0445, \u0447\u0430\u0441\u0442\u044c \u0432 xml-\u0444\u0430\u0439\u043b\u0430\u0445. \u042d\u0442\u043e \u043d\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0438 \u043d\u0435 \u043f\u043b\u043e\u0445\u043e, \u044d\u0442\u043e \u0434\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u2014 \u0432\u0441\u0435 \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438 \u043a <i>web.xml<\/i>, <i>application.xml<\/i>, <i>springmvc-servlet.xml<\/i> \u0438 \u0442.\u0434., \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c\u0438 <i>@ Controller, @ Repository, @ Autowired, @ Value, @ ResponseBody<\/i> \u0438 \u0442.\u0434. \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 3 Spring \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <b>Java-based \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/b>, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 xml-\u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0420\u0430\u043d\u0435\u0435 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 <a href=\"http:\/\/habrahabr.ru\/company\/jugru\/blog\/218203\">\u0431\u044b\u043b\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0441 \u0430\u043d\u0430\u043b\u0438\u0437\u043e\u043c \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432 \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432 \u043e\u0434\u043d\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043f\u0435\u0440\u0435\u0434 \u0434\u0440\u0443\u0433\u0438\u043c\u0438<\/a>, \u0441 \u0440\u044f\u0434\u043e\u043c \u043f\u043b\u044e\u0441\u043e\u0432 xml-\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0433\u043b\u0430\u0441\u0435\u043d.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0440\u0435\u0447\u044c \u043d\u0435 \u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u0445 \u043e\u0434\u043d\u0438\u0445 \u0438\u043b\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432 \u0434\u0440\u0443\u0433\u0438\u0445, \u0438 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u043d\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0430\u0433\u0438\u0442\u0430\u0446\u0438\u0438 \u0437\u0430 \u043d\u043e\u0432\u044b\u0435 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u0438\u0448\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0442\u0447\u0435\u0442 \u043e \u0441\u0431\u043e\u0440\u043a\u0435 \u0432\u0435\u0431-\u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043d\u0443\u043b\u044f \u0434\u043e \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0418 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 embedded \u0441\u0435\u0440\u0432\u0435\u0440\u0430 Jetty. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043a\u0430\u043a \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e Jetty, \u0442\u0430\u043a \u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432 Spring Application, MVC, Security, \u043d\u0430\u0432\u0430\u043b\u043e\u043c. \u041d\u043e \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u044f\u0445 \u044d\u0442\u0438\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a, \u043d\u0435 \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0438 \u043d\u0435 \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u043a\u043e\u0441\u0442\u044b\u043b\u0438, \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u043a\u043e\u0435-\u043a\u0430\u043a\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432. \u041d\u043e \u0434\u0430\u0436\u0435 \u0438\u043c\u0435\u044f \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u0441 \u0440\u044f\u0434\u043e\u043c \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0435\u043d\u0438\u0439, \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438\u0448\u043b\u0430 \u0438\u0434\u0435\u044f \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435.<habracut text=\"\u0414\u0430\u043b\u0435\u0435 \u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u043a\u043e\u0434\u0430\"\/>\u0441\u0442\u0430 \u0438 \u043a\u043e\u0434\u0430&#187;\/><\/p>\n<p>  \u0420\u0430\u043d\u044c\u0448\u0435 \u043c\u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0440\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0430\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0430\u0441\u044c \u043d\u0430 standalone \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0435 (\u043e\u0431\u044b\u0447\u043d\u043e <i>Tomcat<\/i>), \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u044b \u0432\u0435\u0431-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u043b\u0438\u0441\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441\u043e \u0441\u0442\u0430\u0440\u0442\u043e\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0422\u0430\u043a\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0443\u0434\u043e\u0431\u043d\u0430 \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0434\u043e\u0431\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0430\u0447\u043a\u043e\u0439 \u043d\u0430 \u043e\u0434\u043d\u043e\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u043f\u043e\u0434 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u0432\u043e\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440. \u041d\u043e \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u043a\u0440\u0443\u043f\u043d\u0435\u0435, \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u0435\u0435, \u0438 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u0442 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0442\u044c \u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0447\u0430\u0441\u0442\u043e \u0441\u0435\u0431\u044f \u043e\u043f\u0440\u0430\u0432\u0434\u044b\u0432\u0430\u0435\u0442. \u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438: \u0437\u0430\u043f\u0443\u0441\u043a \u0432 IDE \u043f\u0440\u043e\u0441\u0442, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0435\u0433\u043e \u0441\u0442\u0430\u0440\u0442 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f \u00ab\u0432 \u043e\u0434\u043d\u043e \u043a\u0430\u0441\u0430\u043d\u0438\u0435\u00bb. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u043e\u043f\u0440\u043e\u0441 \u0432\u0441\u0442\u0430\u043b \u043d\u0435 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0443, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u00ab\u0437\u0430\u0434\u0430\u0447\u043a\u0430 \u0440\u0430\u0434\u0438 \u0437\u0430\u0434\u0430\u0447\u043a\u0438\u00bb: \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0432\u0441\u0435\u0445 xml, \u0438\u043c\u0435\u0442\u044c \u00ab\u043d\u0430 \u0431\u043e\u0440\u0442\u0443\u00bb <i>embedded Jetty<\/i> \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0435\u0431-\u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 <i>Spring MVC<\/i> \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <i>Spring Security<\/i>.<\/p>\n<p>  \u0417\u0430\u0431\u0435\u0433\u0430\u044f \u0432\u043f\u0435\u0440\u0435\u0434, \u0441\u0440\u0430\u0437\u0443 \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e xml-\u0444\u0430\u0439\u043b\u0430, \u044f \u043d\u0435 \u0438\u0437\u0431\u0430\u0432\u0438\u043b\u0441\u044f \u043e\u0442 \u0432\u0441\u0435\u0445 xml-\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u2014 \u0437\u0432\u0443\u0447\u0438\u0442 \u043f\u0440\u043e\u0432\u043e\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u043e \u0438 \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e, \u043d\u043e \u044d\u0442\u043e \u0442\u0430\u043a: embedded Jetty \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 <i>org.eclipse.jetty.webapp<\/i> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0430\u0439\u043b <i>webdefault.xml<\/i>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u0442 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044f \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u044b <i>DefaultServlet<\/i> \u0438 <i>JspServlet<\/i>, \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u043b\u0438\u0441\u0442\u0435\u043d\u0435\u0440\u044b \u0438 \u044d\u043d\u043a\u043e\u0434\u0435\u0440\u044b \u2014 \u043e\u043a\u043e\u043b\u043e 500 \u0441\u0442\u0440\u043e\u043a xml-\u043a\u043e\u0434\u0430. \u041e\u0434\u043d\u0430\u043a\u043e \u044f \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0443\u0432\u0438\u0434\u0435\u043b \u0432 \u044d\u0442\u043e\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043e\u043a\u0440\u0430\u043b\u044c\u043d\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u043e\u0439\u0442\u0438 \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443, \u043a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0438\u043b\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0435\u0441\u0442\u044c, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0441 \u043f\u0435\u0440\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 Jetty, Tomcat (<i>org.apache.catalina.startup.Tomcat.DefaultWebXmlListener<\/i> \u0434\u043b\u044f embedded \u0438\u043b\u0438 <i>${Catalina}\/conf\/web.xml<\/i> \u0434\u043b\u044f standalone), GlassFish (<i>${glassfish}\/domains\/domain1\/config\/default-web.xml<\/i>), JBoss (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Tomcat), Resin (<i>${resin}\/conf\/app-default.xml<\/i>), Jeronimo (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Tomcat) \u2014 \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043e\u0431\u044b\u0447\u043d\u0430 \u0434\u043b\u044f \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0438 \u0441\u043c\u044b\u0441\u043b\u0430 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0435\u0442. \u0425\u043e\u0442\u044f \u043e\u0442 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0445\u043e\u0442\u044f \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0438 \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0432\u0435\u043d\u043e\u0432\u0441\u043a\u0438\u0439 \u043f\u043b\u0430\u0433\u0438\u043d <i>maven-war-plugin<\/i> \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c <i>failOnMissingWebXml = false<\/i> \u043d\u0435\u0442.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0441\u0442\u0430\u0442\u044c\u044f \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0439 \u043a\u043e\u0434 \u0431\u044b\u043b\u0438 \u043f\u043e\u043b\u043d\u044b\u043c\u0438, \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0435\u043f\u0440\u043e\u0444\u0438\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, maven-\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f, jsp-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 &#8230;<\/p>\n<p>  \u0424\u0430\u0439\u043b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <b>pom.xml<\/b> (\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0430\u043f\u043e\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043d\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u2014 \u043f\u0440\u0438\u0432\u044b\u043a, \u043d\u0435 \u0445\u043e\u0442\u0435\u043b \u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e, \u0434\u0430\u043b\u0435\u0435 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0447\u0442\u0435\u043d\u0438\u044f), \u043f\u043b\u0430\u0433\u0438\u043d\u044b \u043d\u0435 \u0441\u0442\u0430\u043b \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u2014 \u0442\u0435\u043c\u0430 \u0438\u0437\u0431\u0438\u0442\u0430\u044f \u0438 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043d\u044f\u0442\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">pom.xml<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;project xmlns=&quot;http:\/\/maven.apache.org\/POM\/4.0.0&quot; xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/maven-v4_0_0.xsd&quot;&gt; \t&lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt; \t&lt;groupId&gt;com.idvsbruck&lt;\/groupId&gt; \t&lt;artifactId&gt;jetty-spring-test&lt;\/artifactId&gt; \t&lt;packaging&gt;war&lt;\/packaging&gt; \t&lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt; \t&lt;name&gt;test&lt;\/name&gt; \t&lt;description&gt;Embedded Jetty, Spring Java-based configuration&lt;\/description&gt;  \t&lt;developers&gt; \t\t&lt;developer&gt; \t\t\t&lt;id&gt;IDVsbruck&lt;\/id&gt; \t\t&lt;\/developer&gt; \t&lt;\/developers&gt;  \t&lt;properties&gt; \t\t&lt;out.name&gt;${project.artifactId}&lt;\/out.name&gt; \t\t&lt;out.folder&gt;out&lt;\/out.folder&gt; \t\t&lt;source.folder&gt;source&lt;\/source.folder&gt; \t\t&lt;resource.folder&gt;resource&lt;\/resource.folder&gt; \t\t&lt;spring.version&gt;4.1.6.RELEASE&lt;\/spring.version&gt; \t\t&lt;spring.security.version&gt;4.0.0.RELEASE&lt;\/spring.security.version&gt; \t\t&lt;jetty.version&gt;9.3.0.M1&lt;\/jetty.version&gt; \t&lt;\/properties&gt;  \t&lt;build&gt; \t\t&lt;finalName&gt;${out.name}&lt;\/finalName&gt; \t\t&lt;directory&gt;${out.folder}&lt;\/directory&gt; \t\t&lt;testOutputDirectory&gt;${out.folder}&lt;\/testOutputDirectory&gt; \t\t&lt;outputDirectory&gt;${out.folder}&lt;\/outputDirectory&gt; \t\t&lt;testSourceDirectory&gt;${source.folder}&lt;\/testSourceDirectory&gt; \t\t&lt;sourceDirectory&gt;${source.folder}&lt;\/sourceDirectory&gt;  \t\t&lt;resources&gt; \t\t\t&lt;resource&gt; \t\t\t\t&lt;directory&gt;${resource.folder}&lt;\/directory&gt; \t\t\t\t&lt;filtering&gt;true&lt;\/filtering&gt; \t\t\t&lt;\/resource&gt; \t\t&lt;\/resources&gt;  \t\t&lt;plugins&gt; \t\t\t&lt;plugin&gt; \t\t\t\t&lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt; \t\t\t\t&lt;artifactId&gt;maven-compiler-plugin&lt;\/artifactId&gt; \t\t\t\t&lt;version&gt;3.1&lt;\/version&gt; \t\t\t\t&lt;configuration&gt; \t\t\t\t\t&lt;source&gt;1.7&lt;\/source&gt; \t\t\t\t\t&lt;target&gt;1.7&lt;\/target&gt; \t\t\t\t&lt;\/configuration&gt; \t\t\t&lt;\/plugin&gt; \t\t&lt;\/plugins&gt; \t&lt;\/build&gt;  \t&lt;dependencies&gt; \t\t&lt;!-- Embedded Jetty server --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.eclipse.jetty&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;jetty-server&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${jetty.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- Web Application Context Handler --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.eclipse.jetty&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;jetty-webapp&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${jetty.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u043e\u0432, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 Jetty-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438 --&gt; \t\t&lt;!-- \u0414\u043b\u044f \u043f\u0440\u044f\u043c\u043e\u0433\u043e (\u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u043e\u0433\u043e) \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Jetty \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.eclipse.jetty&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;jetty-annotations&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${jetty.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432 Runtime \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 JSP, Jetty \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f JSP --&gt; \t\t&lt;!-- \u041f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 jsp-\u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.eclipse.jetty&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;jetty-jsp&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${jetty.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- Spring MVC \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.springframework&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;spring-webmvc&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${spring.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- Spring ORM \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.springframework&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;spring-orm&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${spring.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- Spring Security \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.springframework.security&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;spring-security-core&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${spring.security.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.springframework.security&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;spring-security-web&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${spring.security.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.springframework.security&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;spring-security-config&lt;\/artifactId&gt; \t\t\t&lt;version&gt;${spring.security.version}&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- \u041b\u043e\u0433\u0433\u0435\u0440 --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.slf4j&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;slf4j-log4j12&lt;\/artifactId&gt; \t\t\t&lt;version&gt;1.7.5&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- Hibernate ORM \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.hibernate&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;hibernate-core&lt;\/artifactId&gt; \t\t\t&lt;version&gt;4.3.8.Final&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- \u041d\u0430\u0431\u043e\u0440 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432 \u0438\u0437 org.hibernate.validator.constraints \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0438\u0437 javax.validation.constraints --&gt; \t\t&lt;!-- \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 - \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0448\u0438\u0431\u043e\u043a --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.hibernate&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;hibernate-validator&lt;\/artifactId&gt; \t\t\t&lt;version&gt;5.1.3.Final&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f DBCP \u043e\u0442 Apache --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.apache.commons&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;commons-dbcp2&lt;\/artifactId&gt; \t\t\t&lt;version&gt;2.0.1&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- \u041a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440 \u043a \u0411\u0414 MySQL (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u044d\u0442\u0443 \u0411\u0414) --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;mysql&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;mysql-connector-java&lt;\/artifactId&gt; \t\t\t&lt;version&gt;5.1.31&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- Spring Security \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043a\u043b\u0430\u0441\u0441\u044b \u0438\u0437 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u043e\u043b\u0435\u0432\u044b\u0445 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 jsr250 --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;javax.annotation&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;jsr250-api&lt;\/artifactId&gt; \t\t\t&lt;version&gt;1.0&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t&lt;\/dependencies&gt; &lt;\/project&gt; <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <b>WEB-INF\/application.properties<\/b>:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">application.properties<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>base.url=\/test base.port=8080  database.url=jdbc:mysql:\/\/localhost:3306\/test database.user=root database.password=root  log4j.rootLogger=INFO, CONSOLE log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n  log4j.logger.org.hibernate=WARN<\/code><\/pre>\n<\/div>\n<\/div>\n<p><\/habracut><\/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-255295","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/255295","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=255295"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/255295\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=255295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=255295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=255295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}