{"id":291135,"date":"2018-10-22T00:50:02","date_gmt":"2018-10-21T20:50:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=291135"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=291135","title":{"rendered":"\u041f\u0438\u0448\u0435\u043c \u0441 IoC Starter. \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043c\u0430\u043f\u043f\u0438\u043d\u0433 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f context, web \u0438 orm"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/dcd\/618\/78b\/dcd61878b1e937703174d42d5fe7e3eb.png\" alt=\"image\">  <\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0421 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430 \u043f\u0440\u043e\u0448\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (<a href=\"https:\/\/habr.com\/post\/422857\/\">\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e<\/a>). \u0427\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c?<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0430 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u0446\u0435\u043b\u043e\u043c;<\/li>\n<li>\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043b\u0435\u043d\u0438\u0432\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432;<\/li>\n<li>\u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0435\u0439;<\/li>\n<li>\u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0430\u0441\u043f\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u0434\u043b\u044f \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447, \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0441\u0435 \u0436\u0435 \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u2014 AspectJ \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443)<\/li>\n<li>\u043d\u043e\u0432\u044b\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a RequestFactory<\/li>\n<\/ul>\n<p>  <\/p>\n<p>**\u041c\u043e\u0434\u0443\u043b\u0438<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043c\u043e\u0434\u0443\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u0435\u0448\u0435\u043c \u043d\u0430 \u0431\u0430\u0437\u0435 EhCache, Guava<\/li>\n<li>\u043c\u043e\u0434\u0443\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u043e\u0442\u043e\u043a\u0430\u043c\u0438 (\u043a\u0430\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 @SimpleTask, \u0442\u0430\u043a \u0438 \u043f\u0440\u044f\u043c\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0443\u043b\u043e\u043c)<\/li>\n<li>\u043c\u043e\u0434\u0443\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 (\u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0439 ORM \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 JPA, Transactions, NO-SQL Driver \u2014 Orient, Crud methods, repository system \u0438 \u0430\u0432\u0442\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f)<\/li>\n<li>\u043c\u043e\u0434\u0443\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u0435\u0431-\u043c\u043e\u0440\u0434\u043e\u0439 (\u043c\u0430\u043f\u043f\u0438\u043d\u0433 \u043b\u0438\u043d\u043a\u043e\u0432 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 producers\/consumes, Velocity Template Rendering Page, Basic Security Requests, Sessions, Cookies, SSL) \u043d\u0430 \u0431\u0430\u0437\u0435 Netty 4.1.30.Final<\/li>\n<\/ul>\n<p>  <\/p>\n<p>&#171;\u042d\u0442\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e,&#187;- \u0441\u043a\u0430\u0436\u0438\u0442\u0435 \u0412\u044b, -&#171;\u043d\u043e \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0438 \u044d\u0442\u043e \u0432\u0441\u0435?&#187;.<br \/>  &#171;\u0414\u0430, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442&#187;.<\/p>\n<p>  <\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Maven 3 \u0438 Intelijj Idea 2018.2.<\/p>\n<p>  <\/p>\n<p>1) \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438:<a name=\"habracut\"><\/a><\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt; &lt;project xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"          xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\"          xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"&gt;     &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;     &lt;artifactId&gt;example-webapp&lt;\/artifactId&gt;     &lt;packaging&gt;jar&lt;\/packaging&gt;      &lt;build&gt;         &lt;plugins&gt;             &lt;plugin&gt;                 &lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;                 &lt;artifactId&gt;maven-compiler-plugin&lt;\/artifactId&gt;                 &lt;version&gt;3.8.0&lt;\/version&gt;                 &lt;configuration&gt; ```1.8&lt;\/source&gt;                     &lt;target&gt;1.8&lt;\/target&gt;                 &lt;\/configuration&gt;                  &lt;executions&gt;                     &lt;execution&gt;                         &lt;id&gt;default-testCompile&lt;\/id&gt;                         &lt;phase&gt;test-compile&lt;\/phase&gt;                         &lt;goals&gt;                             &lt;goal&gt;testCompile&lt;\/goal&gt;                         &lt;\/goals&gt;                     &lt;\/execution&gt;                 &lt;\/executions&gt;             &lt;\/plugin&gt;         &lt;\/plugins&gt;     &lt;\/build&gt;      &lt;dependencies&gt;         &lt;dependency&gt;             &lt;groupId&gt;org.ioc&lt;\/groupId&gt;             &lt;artifactId&gt;context-factory&lt;\/artifactId&gt;             &lt;version&gt;2.2.4.STABLE&lt;\/version&gt;         &lt;\/dependency&gt;          &lt;dependency&gt;             &lt;groupId&gt;org.ioc&lt;\/groupId&gt;             &lt;artifactId&gt;orm-factory&lt;\/artifactId&gt;             &lt;version&gt;2.2.4.STABLE&lt;\/version&gt;         &lt;\/dependency&gt;          &lt;dependency&gt;             &lt;groupId&gt;org.ioc&lt;\/groupId&gt;             &lt;artifactId&gt;web-factory&lt;\/artifactId&gt;             &lt;version&gt;2.2.4.STABLE&lt;\/version&gt;         &lt;\/dependency&gt;     &lt;\/dependencies&gt;      &lt;repositories&gt;         &lt;repository&gt;             &lt;id&gt;context&lt;\/id&gt;             &lt;url&gt;https:\/\/raw.github.com\/GenCloud\/ioc_container\/context&lt;\/url&gt;         &lt;\/repository&gt;         &lt;repository&gt;             &lt;id&gt;cache&lt;\/id&gt;             &lt;url&gt;https:\/\/raw.github.com\/GenCloud\/ioc_container\/cache&lt;\/url&gt;         &lt;\/repository&gt;         &lt;repository&gt;             &lt;id&gt;threading&lt;\/id&gt;             &lt;url&gt;https:\/\/raw.github.com\/GenCloud\/ioc_container\/threading&lt;\/url&gt;         &lt;\/repository&gt;         &lt;repository&gt;             &lt;id&gt;orm&lt;\/id&gt;             &lt;url&gt;https:\/\/raw.github.com\/GenCloud\/ioc_container\/orm&lt;\/url&gt;         &lt;\/repository&gt;         &lt;repository&gt;             &lt;id&gt;web&lt;\/id&gt;             &lt;url&gt;https:\/\/raw.github.com\/GenCloud\/ioc_container\/web&lt;\/url&gt;         &lt;\/repository&gt;     &lt;\/repositories&gt; &lt;\/project&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>**\u041d\u0430 maven central \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0435\u0445\u0430\u043b, \u0443\u0432\u044b.<\/p>\n<p>  <\/p>\n<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/7f9\/a76\/30f\/7f9a7630f5f5b2e3a53a4013fd0b38c2.png\" alt=\"\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\"><br \/>  \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 MVC \u043f\u0430\u0442\u0442\u0435\u0440\u043d, \u043d\u0435 \u043f\u0440\u0430\u0432\u0434\u0430 \u043b\u0438?<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u043e\u0447\u043a\u0443 \u0432\u0445\u043e\u0434\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">package org.examples.webapp;  import org.ioc.annotations.context.ScanPackage; import org.ioc.annotations.modules.CacheModule; import org.ioc.annotations.modules.DatabaseModule; import org.ioc.annotations.modules.ThreadingModule; import org.ioc.annotations.modules.WebModule; import org.ioc.context.starter.IoCStarter;  @WebModule @CacheModule @ThreadingModule @DatabaseModule @ScanPackage(packages = {\"org.examples.webapp\"}) public class AppMain {     public static void main(String[] args) {         IoCStarter.start(AppMain.class);     } }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>**\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f:<\/strong><br \/>  <strong>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @ScanPackages<\/strong> \u2014 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443 \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u043b\u044f \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 (\u0432 \u043f\u0440\u043e\u0441\u0442\u043e\u043d\u0430\u0440\u043e\u0434\u0438\u0438 \u2014 &#171;\u0431\u0438\u043d\u043e\u0432&#187;).<br \/>  <strong>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @WebModule<\/strong> \u2014 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 web \u0444\u0430\u0431\u0440\u0438\u043a\u0438.<br \/>  <strong>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @CacheModule<\/strong> \u2014 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u043a\u0435\u0448\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b ORM (\u0432 \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f).<br \/>  <strong>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @ThreadingModule<\/strong> \u2014 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b web \u0444\u0430\u0431\u0440\u0438\u043a\u0438 (\u0432 \u0431\u0443\u0434\u0443\u0449\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f).<br \/>  <strong>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @DatabaseModule<\/strong> \u2014 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0430\u0431\u0440\u0438\u043a\u0438 ORM.<br \/>  \u0412\u0441\u0435 \u0444\u0430\u0431\u0440\u0438\u043a\u0438 \u0438\u043c\u0435\u044e\u0442 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u0441\u0432\u043e\u0438 \u0441 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0444\u0430\u0431\u0440\u0438\u043a\u0430\u043c\u0438 (\u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d \u043a\u043b\u0430\u0441\u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440 \u2014 <strong>Class&lt;?&gt; autoConfigurationClass() default WebAutoConfiguration.class<\/strong>), \u043b\u0438\u0431\u043e \u0436\u0435 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <strong>@Exclude<\/strong> \u0432 main \u043a\u043b\u0430\u0441\u0441\u0435.<br \/>  \u0423\u0442\u0438\u043b\u0438\u0442\u0430 IoCStarter \u2014 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441-\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u041d\u0443 \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u0432\u0441\u0435 \u0438 \u0433\u043e\u0442\u043e\u0432\u043e, \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0432\u0435\u0431 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u043c \u043f\u043e\u0440\u0442\u0443 8081, \u043d\u043e \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438 \u043d\u0435\u0442 \u0438 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043d\u0430 \u0441\u0430\u0439\u0442 \u043d\u0430\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u0442\u043e\u043b\u043a\u043e\u043c \u043d\u0435 \u0432\u044b\u0434\u0430\u0435\u0442. \u0427\u0442\u043e \u0436, \u0438\u0434\u0435\u043c \u0434\u0430\u043b\u044c\u0448\u0435.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u041f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u0443 \u0432\u0441\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0433\u0440\u0443\u0437\u044f\u0442\u0441\u044f \u0438\u0437 {working_dir}\/configs\/default_settings.properties \u2014 \u0435\u0433\u043e \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c\u0443 \u043f\u0443\u0442\u0438.<\/p>\n<p>  <\/p>\n<pre><code># Threading ioc.threads.poolName=shared ioc.threads.availableProcessors=4 ioc.threads.threadTimeout=0 ioc.threads.threadAllowCoreTimeOut=true ioc.threads.threadPoolPriority=NORMAL # Event dispather # \u043a\u043e\u043b-\u0432\u043e \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u043e\u0432 (\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432) \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0435\u0439 (\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435) ioc.dispatcher.availableDescriptors=4 # Cache # \u0444\u0430\u0431\u0440\u0438\u043a\u0430 \u043a\u0435\u0448\u0430 (EhFactory|GuavaFactory) cache.factory=org.ioc.cache.impl.EhFactory # Datasource # \u0442\u0438\u043f \u0431\u0430\u0437\u044b (\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f-\u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f, \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f-\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0430\u044f) #LOCAL, LOCAL_SERVER, REMOTE datasource.orient.database-type=LOCAL # \u043c\u0435\u0441\u0442\u043e\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0431\u0430\u0437\u044b datasource.orient.url=.\/database # \u0438\u043c\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 (\u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e) datasource.orient.database=orient # \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0430\u0437\u044b datasource.orient.username=admin # \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f datasource.orient.password=admin # \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u0431\u0430\u0437\u0443 (create, dropCreate, refresh, none) datasource.orient.ddl-auto=dropCreate # \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0430\u044e\u0449\u0430\u044f \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0443, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438\u043b\u0438 \u043d\u0435\u0442 datasource.orient.showSql=true # Web server # \u043f\u043e\u0440\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 web.server.port=8081 # \u043d\u0443\u0436\u0435\u043d \u043b\u0438 SSL \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a web.server.ssl-enabled=false # in seconds # \u0442\u0430\u0439\u043c\u0430\u0443\u0442 \u0441\u0435\u0441\u0441\u0438\u0439 (\u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 7200 \u0441\u0435\u043a. = 2 \u0447\u0430\u0441\u0430) web.server.security.session.timeout=300 # \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0438 \u0432\u0435\u0431-\u043c\u043e\u0440\u0434\u044b web.server.velocity.input.encoding=UTF-8 web.server.velocity.output.encoding=UTF-8 # \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a \u0432\u0435\u0431-\u043c\u043e\u0440\u0434\u044b web.server.velocity.resource.loader=file # \u043a\u043b\u0430\u0441\u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a\u0430 web.server.velocity.resource.loader.class=org.apache.velocity.runtime.resource.loader.FileResourceLoader # \u043f\u0443\u0442\u044c \u043a \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0435\u0439\u0441\u044f \u0432\u0435\u0431-\u043c\u043e\u0440\u0434\u0435 web.server.velocity.resource.loading.path=.\/public<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0435\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439:<br \/>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 TblAccount:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">package org.examples.webapp.domain.entity;  import org.ioc.web.security.user.UserDetails;  import javax.persistence.*; import java.util.Collections; import java.util.List;  @Entity public class TblAccount implements UserDetails {     @Id     @GeneratedValue(strategy = GenerationType.SEQUENCE)     private long id;      @Column(name = \"username\")     private String username;      @Column(name = \"password\")     private String password;      @Transient     private String repeatedPassword;      public String getRepeatedPassword() {         return repeatedPassword;     }      public void setRepeatedPassword(String repeatedPassword) {         this.repeatedPassword = repeatedPassword;     }      @Override     public String getUsername() {         return username;     }      public void setUsername(String username) {         this.username = username;     }      @Override     public String getPassword() {         return password;     }      public void setPassword(String password) {         this.password = password;     }      @Override     public List&lt;String&gt; getRoles() {         return Collections.singletonList(\"ROLE_USER\");     } }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>**\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f:<\/strong><br \/>  \u0412\u0441\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e \u043a\u0430\u043a \u0438 \u0443 \u0432\u0441\u0435\u0445 JPA-\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432. \u041c\u0430\u043f\u043f\u0438\u043c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>@.Entity<\/strong>, \u0441\u043e\u0437\u0434\u0430\u0435\u043c Primary Key \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <strong>@.Id<\/strong>, \u043c\u0430\u043f\u043f\u0438\u043c \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <strong>@Column.<\/strong> \u0438 \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u0441\u044f \u043e\u0442 <strong>UserDetails<\/strong> \u0434\u043b\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0432 <strong>Security<\/strong> \u043c\u043e\u0434\u0443\u043b\u0435.<\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 TblAccountRepository:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">package org.examples.webapp.domain.repository;  import org.examples.webapp.domain.entity.TblAccount; import org.ioc.annotations.context.IoCRepository; import org.ioc.orm.repositories.CrudRepository;  import javax.transaction.Transactional;  @IoCRepository public interface TblAccountRepository extends CrudRepository&lt;TblAccount, Long&gt; {     @Transactional     TblAccount findByUsernameEq(String username); }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>**\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f:<\/strong><br \/>  <strong>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @IoCRepository<\/strong> \u2014 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c, \u0447\u0442\u043e \u043a\u043b\u0430\u0441\u0441 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u043c\u0438 \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c <strong>&#171;\u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443&#187;<\/strong>.<br \/>  \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 <em>CRUD<\/em> \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li><strong>Entity fetch(ID id)<\/strong> \u2014 \u0434\u043e\u0441\u0442\u0430\u0435\u0442 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0442\u0438\u043f\u0430 Entity \u0438\u0437 \u0431\u0430\u0437\u044b, \u043b\u0438\u0431\u043e \u0438\u0437 \u043a\u0435\u0448\u0430 \u043f\u043e Primary Key;<\/li>\n<li><strong>List fetchAll() \u2014 \u0434\u043e\u0441\u0442\u0430\u0435\u0442 \u0432\u0441\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0442\u0438\u043f\u0430 Entity, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044f \u0438\u0445 \u0432 \u043a\u0435\u0448; <\/strong><\/li>\n<li><strong>void save(Entity entity)<\/strong> \u2014 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\/\u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0442\u0438\u043f\u0430 Entity \u043a\u0430\u043a \u0432 \u0431\u0430\u0437\u0435 \u0442\u0430\u043a \u0438 \u0432 \u043a\u0435\u0448\u0435;<\/li>\n<li><strong>void delete(Entity entity)<\/strong> \u2014 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0442\u0438\u043f\u0430 Entity \u043a\u0430\u043a \u0438\u0437 \u0431\u0430\u0437\u044b \u0442\u0430\u043a \u0438 \u0438\u0437 \u043a\u0435\u0448\u0430;<\/li>\n<li><strong>boolean exists(ID id)<\/strong> \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0432 \u0431\u0430\u0437\u0435 \u043f\u043e Primary Key.<br \/>  \u0412\u0441\u0435 CRUD-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0432 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043a\u0430\u043a \u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0448\u0435 (<strong>TblAccount findByUsernameEq(String username)<\/strong>) \u0438 \u0432\u044b\u0437\u043e\u0432 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (<strong>NamedQuery<\/strong>)<\/p>\n<p>  <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>findByUsernameEq(String username)<\/strong> \u2014 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u0438\u0441\u043a \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0435\u0435 \u043f\u043e\u043b\u044e <strong>username<\/strong>. \u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441: <\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">     select * from tbl_account where username = 'username'<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f, \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u043e\u0439.<br \/>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 AccountService:<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">package org.examples.webapp.service;  import org.examples.webapp.domain.entity.TblAccount; import org.examples.webapp.domain.repository.TblAccountRepository; import org.examples.webapp.responces.IMessage; import org.ioc.annotations.context.IoCComponent; import org.ioc.annotations.context.IoCDependency; import org.ioc.web.model.http.Request; import org.ioc.web.security.configuration.SecurityConfigureAdapter; import org.ioc.web.security.encoder.bcrypt.BCryptEncoder; import org.ioc.web.security.user.UserDetails; import org.ioc.web.security.user.UserDetailsProcessor;  import java.util.Objects;  import static org.examples.webapp.responces.IMessage.Type.ERROR; import static org.examples.webapp.responces.IMessage.Type.OK;  @IoCComponent public class AccountService implements UserDetailsProcessor {     @IoCDependency     private TblAccountRepository tblAccountRepository;      @IoCDependency     private BCryptEncoder bCryptEncoder;      @IoCDependency     private SecurityConfigureAdapter securityConfigureAdapter;      @Override     public UserDetails loadUserByUsername(String username) {         return tblAccountRepository.findByUsernameEq(username);     }      public void save(TblAccount tblAccount) {         tblAccountRepository.save(tblAccount);     }      public void delete(TblAccount tblAccount) {         tblAccountRepository.delete(tblAccount);     }      public IMessage tryCreateUser(String username, String password, String repeatedPassword) {         if (username == null || username.isEmpty() || password == null || password.isEmpty()                 || repeatedPassword == null || repeatedPassword.isEmpty()) {             return new IMessage(ERROR, \"Invalid request parameters!\");         }          if (!Objects.equals(password, repeatedPassword)) {             return new IMessage(ERROR, \"Repeated password doesn't match!\");         }          final UserDetails userDetails = loadUserByUsername(username);         if (userDetails != null) {             return new IMessage(ERROR, \"Account already exists!\");         }          final TblAccount account = new TblAccount();         account.setUsername(username);         account.setPassword(bCryptEncoder.encode(password));          save(account);         return new IMessage(OK, \"Successfully created!\");     }      public IMessage tryAuthenticateUser(Request request, String username, String password) {         if (username == null || username.isEmpty() || password == null || password.isEmpty()) {             return new IMessage(ERROR, \"Invalid request parameters!\");         }          final UserDetails userDetails = loadUserByUsername(username);         if (userDetails == null) {             return new IMessage(ERROR, \"Account not found!\");         }          if (!bCryptEncoder.match(password, userDetails.getPassword())) {             return new IMessage(ERROR, \"Password does not match!\");         }          securityConfigureAdapter.getContext().authenticate(request, userDetails);         return new IMessage(OK, \"Successfully authenticated\");     }      public IMessage logout(Request request) {         if (securityConfigureAdapter.getContext().removeAuthInformation(request)) {             return new IMessage(OK, \"\/\");         }          return new IMessage(ERROR, \"Credentials not found or not authenticated!\");     } }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>**\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f:<\/strong><br \/>  <strong>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @IoCComponent<\/strong> \u2014 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u043a\u0430\u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<br \/>  <strong>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @IoCDependency<\/strong> \u2014 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u043a\u043b\u0430\u0441\u0441\u0430.<br \/>  <strong>\u0423\u0442\u0438\u043b\u0438\u0442\u0430 BCryptEncoder<\/strong> \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u0434\u0435\u043a\u0430 BCrypt \u0434\u043b\u044f \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u044f (\u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u0434\u0435\u043a).<br \/>  <strong>\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 SecurityConfigureAdapter<\/strong> \u2014 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0441\u0435\u0441\u0441\u0438\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<br \/>  <strong> \u0424\u0443\u043d\u043a\u0446\u0438\u044f UserDetails loadUserByUsername <\/strong> \u2014 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>UserDetailsProcessor<\/strong>, \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0441\u0435\u0441\u0441\u0438\u044e \u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0444\u043b\u0430\u0433\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 (\u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0434\u043b\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 <strong>Security<\/strong>)<br \/>  <strong> \u0424\u0443\u043d\u043a\u0446\u0438\u044f IMessage tryCreateUser<\/strong> \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<br \/>  <strong> \u0424\u0443\u043d\u043a\u0446\u0438\u044f IMessage tryAuthenticateUser<\/strong> \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<br \/>  <strong> \u0424\u0443\u043d\u043a\u0446\u0438\u044f IMessage logout<\/strong> \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0441\u0435\u0441\u0441\u0438\u0438 \u043e\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<br \/>  <strong> \u041a\u043b\u0430\u0441\u0441 IMessage<\/strong> \u2014 \u043a\u043b\u0430\u0441\u0441-\u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0434\u043b\u044f \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u043d\u0443\u0436\u043d\u043e\u0439 \u043d\u0430\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 (json-\u043e\u0442\u0432\u0435\u0442).<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">package org.examples.webapp.responces;  public class IMessage {     private final String message;     private final Type type;      public IMessage(String message) {         this.message = message;         type = Type.OK;     }      public IMessage(Type type, String message) {         this.message = message;         this.type = type;     }      public String getMessage() {         return message;     }      public Type getType() {         return type;     }      public enum Type {         OK,         ERROR     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0430\u043c\u043e\u0439 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0438 (\u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432):<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">package org.examples.webapp.mapping;  import org.examples.webapp.domain.entity.TblAccount; import org.examples.webapp.responces.IMessage; import org.examples.webapp.service.AccountService; import org.ioc.annotations.context.IoCDependency; import org.ioc.annotations.web.IoCController; import org.ioc.web.annotations.Credentials; import org.ioc.web.annotations.MappingMethod; import org.ioc.web.annotations.RequestParam; import org.ioc.web.annotations.UrlMapping; import org.ioc.web.model.ModelAndView; import org.ioc.web.model.http.Request;  @IoCController @UrlMapping(\"\/\") public class MainMapping {     @IoCDependency     private AccountService accountService;      @UrlMapping     public ModelAndView index() {         final ModelAndView modelAndView = new ModelAndView();         modelAndView.setView(\"index\");         return modelAndView;     }      @UrlMapping(value = \"signup\", method = MappingMethod.POST)     public IMessage createUser(@RequestParam(\"username\") String username,                                @RequestParam(\"password\") String password,                                @RequestParam(\"repeatedPassword\") String repeatedPassword) {         return accountService.tryCreateUser(username, password, repeatedPassword);     }      @UrlMapping(value = \"signin\", method = MappingMethod.POST)     public IMessage auth(Request request,                          @RequestParam(\"username\") String username,                          @RequestParam(\"password\") String password) {         return accountService.tryAuthenticateUser(request, username, password);     }      @UrlMapping(\"signout\")     public IMessage signout(Request request) {         return accountService.logout(request);     }      @UrlMapping(\"loginPage\")     public ModelAndView authenticated(@Credentials TblAccount account) {         final ModelAndView modelAndView = new ModelAndView();         modelAndView.setView(\"auth\");          modelAndView.addAttribute(\"account\", account);         return modelAndView;     } }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>**\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f:<\/strong><br \/>  <strong>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @IoCController<\/strong> \u2014 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435, \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 (\u043c\u0430\u043f\u043f\u0435\u0440\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430)<br \/>  <strong>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @UrlMapping<\/strong> \u2014 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e\/\u043a\u043b\u0430\u0441\u0441 \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0430\u043c\u0438 \u043a\u0430\u043d\u0430\u043b\u0430.<br \/>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<p>  <\/p>\n<ul>\n<li><strong>value<\/strong> \u2014 \u043d\u0443\u0436\u043d\u044b\u0439 \u043d\u0430\u043c \u0437\u0430\u043f\u0440\u043e\u0441;<\/li>\n<li><strong>method<\/strong> \u2014 http \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 (GET, POST, PUT, etc.);<\/li>\n<li><strong>consumes<\/strong> \u2014 http mime type \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 (\u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e);<\/li>\n<li><strong>produces<\/strong> \u2014 http content-type \u0434\u043b\u044f \u043e\u0442\u0434\u0430\u0447\u0438 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 (Content-Type: text\/html; charset=utf-8, Content-Type: multipart\/form-data; boundary=something, etc. \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e;<\/li>\n<\/ul>\n<p>  <\/p>\n<p><strong>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @RequestParam<\/strong> \u2014 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u043e\u0441\u0442\u043e\u043b\u044c\u043a\u0443 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0438 \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0438\u043c\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043c\u0435\u0442\u043e\u0434\u0430, \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u043b\u0435\u043d\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u044e\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c javaassist, \u0448\u0430\u043c\u0430\u043d\u0438\u0442\u044c \u0441 \u0430\u0441\u043c\u043e\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0442\u0430\u043a\u043e\u0439 \u0441\u0435\u0431\u0435 \u043c\u0435\u0442\u043e\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0434\u043b\u044f \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u043c\u0443 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0430\u043d\u0430\u043b\u043e\u0433 \u0434\u043b\u044f <strong>GET<\/strong> \u0442\u0438\u043f\u0430 \u2014 <strong>@PathVariable<\/strong> \u2014 \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b (\u043d\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 <strong>POST<\/strong>).<br \/>  <strong>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @Credentials<\/strong> \u2014 \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0442\u0435\u043a\u0443\u0449\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c null, \u0435\u0441\u043b\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0435\u0442 \u0432 \u0441\u0435\u0441\u0438\u0438.<br \/>  <strong> \u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 Request<\/strong> \u2014 \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0432\u0448\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0430\u044f \u0432 \u0441\u0435\u0431\u0435 \u043a\u043e\u043a\u0438, \u0445\u0438\u0434\u0435\u0440\u044b \u0438 \u043a\u0430\u043d\u0430\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c Push Message&#8217;s\u2026 \u0443 \u043a\u043e\u0433\u043e \u043a\u0430\u043a\u0430\u044f \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u044f \u0443\u0436\u0435 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0441\u0447\u0435\u0442.<br \/>  <strong> \u041a\u043b\u0430\u0441\u0441-\u0443\u0442\u0438\u043b\u0438\u0442\u0430 ModelAndView<\/strong> \u2014 \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0431\u0435\u0437 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f, \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u0441\u0443\u0440\u0441.<\/p>\n<p>  <\/p>\n<p>\u0412\u0440\u043e\u0434\u0435 \u0431\u044b \u0432\u0441\u0435, \u043d\u043e \u043d\u0435\u0442 \u2014 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u043c\u0430\u043f\u043f\u0438\u043d\u0433 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">package org.examples.webapp.config;  import org.ioc.annotations.configuration.Property; import org.ioc.annotations.configuration.PropertyFunction; import org.ioc.web.security.configuration.HttpContainer; import org.ioc.web.security.configuration.SecurityConfigureProcessor; import org.ioc.web.security.encoder.Encoder; import org.ioc.web.security.encoder.bcrypt.BCryptEncoder; import org.ioc.web.security.filter.CorsFilter; import org.ioc.web.security.filter.CsrfFilter;  @Property public class SecurityConfig implements SecurityConfigureProcessor {     @Override     public void configure(HttpContainer httpContainer) {         httpContainer.                 configureRequests().                 anonymousRequests(\"\/\", \"\/signup\", \"\/signin\").                 resourceRequests(\"\/static\/**\").                 authorizeRequests(\"\/loginPage\", \"ROLE_USER\").                 authorizeRequests(\"\/signout\", \"ROLE_USER\").                 and().                 configureSession().                 expiredPath(\"\/\");     }      @PropertyFunction     public CsrfFilter csrfFilter() {         return new CsrfFilter();     }      @PropertyFunction     public CorsFilter corsFilter() {         return new CorsFilter();     }      @PropertyFunction     public Encoder encoder() {         return new BCryptEncoder();     } }<\/code><\/pre>\n<p>  <\/p>\n<p><strong>**\u041f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u044f:<\/strong><br \/>  <strong>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @Property<\/strong> \u2014 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443, \u0447\u0442\u043e \u044d\u0442\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0438 \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<br \/>  <strong>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f @PropertyFunction<\/strong> \u2014 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439, \u0447\u0442\u043e \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0442\u0438\u043f \u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u0435\u0433\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 (\u0431\u0438\u043d).<br \/>  <strong>\u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 SecurityConfigureProcessor<\/strong> \u2014 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0441\u043b\u0443\u0436\u0430\u0449\u0430\u044f \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<br \/>  <strong>\u041a\u043b\u0430\u0441\u0441-\u043c\u043e\u0434\u0435\u043b\u044c HttpContainer<\/strong> \u2014 \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u0445\u0440\u0430\u043d\u044f\u0449\u0430\u044f \u0432 \u0441\u0435\u0431\u0435 \u043c\u0430\u043f\u043f\u0438\u043d\u0433 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c.<br \/>  <strong>\u041a\u043b\u0430\u0441\u0441 CsrfFilter<\/strong> \u2014 \u0444\u0438\u043b\u044c\u0442\u0440 \u043d\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0438 CSRF).<br \/>  <strong>\u041a\u043b\u0430\u0441\u0441 CorsFilter<\/strong> \u2014 \u0444\u0438\u043b\u044c\u0442\u0440 Cross-Origin Resource Sharing.<\/p>\n<p>  <\/p>\n<p><strong>\u0424\u0443\u043d\u043a\u0446\u0438\u044f anonymousRequests<\/strong> \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u043e\u043b\u0435\u0439 (ROLE_ANONYMOUS).<br \/>  <strong>\u0424\u0443\u043d\u043a\u0446\u0438\u044f resourceRequests<\/strong> \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f, \u043f\u043e \u043a\u0430\u043a\u043e\u043c\u0443 \u043f\u0443\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0435\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 (css, js, images, etc.).<br \/>  <strong>\u0424\u0443\u043d\u043a\u0446\u0438\u044f authorizeRequests<\/strong> \u2014 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0440\u043e\u043b\u044c, \u043f\u0440\u0438\u0441\u0443\u0449\u0443\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e.<br \/>  <strong>\u0424\u0443\u043d\u043a\u0446\u0438\u044f expiredPath<\/strong> \u2014 \u043f\u0440\u0438 \u043e\u0447\u0438\u0441\u0442\u043a\u0435 \u0438\u0441\u0442\u0435\u043a\u0448\u0435\u0439 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u0435\u0441\u0441\u0438\u0438, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0443 (redirect link).<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0436, \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u0441\u0442\u0438\u043b\u0438 \u0441\u0430\u0439\u0442\u0430 (\u0433\u043b\u0443\u0431\u043e\u043a\u043e \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0443).<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<p>index.vm \u2014 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;html&gt; &lt;head&gt;     &lt;meta charset=\"utf-8\"\/&gt;     &lt;title&gt;IoC Test&lt;\/title&gt;     &lt;link rel=\"stylesheet\" href=\"\/static\/css\/bootstrap.min.css\"&gt;      &lt;link rel=\"stylesheet\" href=\"\/static\/css\/style.css\"\/&gt;     &lt;link rel=\"stylesheet\" href=\"\/static\/css\/pnotify.custom.min.css\"\/&gt;     &lt;link rel=\"stylesheet\" href=\"\/static\/css\/pnotify.css\"\/&gt;     &lt;link rel=\"stylesheet\" href=\"\/static\/css\/pnotify.buttons.css\"\/&gt; &lt;\/head&gt; &lt;body&gt; &lt;div class=\"container\"&gt;     &lt;h1&gt;IoC Starter Test&lt;\/h1&gt;     &lt;br&gt;     &lt;h4&gt;Create user&lt;\/h4&gt;     &lt;br&gt;     &lt;form id=\"creation\"&gt;         &lt;label for=\"username\"&gt;Username: &lt;\/label&gt;         &lt;input type=\"text\" id=\"username\" name=\"username\" class=\"color-input-field\"\/&gt;         &lt;label for=\"password\"&gt;Password: &lt;\/label&gt;         &lt;input type=\"password\" id=\"password\" name=\"password\" class=\"color-input-field\"\/&gt;         &lt;label for=\"repeatedPassword\"&gt;Repeate: &lt;\/label&gt;         &lt;input type=\"password\" id=\"repeatedPassword\" name=\"repeatedPassword\" class=\"color-input-field\"\/&gt;         &lt;button type=\"button\" class=\"btn btn-success btn-create\"&gt;Sing up!&lt;\/button&gt;     &lt;\/form&gt;      &lt;h4&gt;Authenticate&lt;\/h4&gt;     &lt;br&gt;     &lt;form id=\"auth\"&gt;         &lt;label for=\"username\"&gt;Username: &lt;\/label&gt;         &lt;input type=\"text\" id=\"username\" name=\"username\" class=\"color-input-field\"\/&gt;         &lt;label for=\"password\"&gt;Password: &lt;\/label&gt;         &lt;input type=\"password\" id=\"password\" name=\"password\" class=\"color-input-field\"\/&gt;         &lt;button type=\"button\" class=\"btn btn-danger btn-auth\"&gt;Sing in!&lt;\/button&gt;     &lt;\/form&gt; &lt;\/div&gt;  &lt;script type=\"text\/javascript\" src=\"\/static\/js\/jquery.js\"&gt;&lt;\/script&gt; &lt;script type=\"text\/javascript\" src=\"\/static\/js\/bootstrap.min.js\"&gt;&lt;\/script&gt; &lt;script type=\"text\/javascript\" src=\"\/static\/js\/scripts.js\"&gt;&lt;\/script&gt; &lt;script type=\"text\/javascript\" src=\"\/static\/js\/pnotify.js\"&gt;&lt;\/script&gt; &lt;script type=\"text\/javascript\" src=\"\/static\/js\/pnotify.buttons.js\"&gt;&lt;\/script&gt;  &lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>auth.vm \u2014 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/p>\n<p>  <\/p>\n<pre><code class=\"xml\">&lt;html&gt; &lt;head&gt;     &lt;meta charset=\"utf-8\"\/&gt;     &lt;title&gt;IoC Test&lt;\/title&gt;     &lt;link rel=\"stylesheet\" href=\"\/static\/css\/bootstrap.min.css\"&gt;      &lt;link rel=\"stylesheet\" href=\"\/static\/css\/style.css\"\/&gt;     &lt;link rel=\"stylesheet\" href=\"\/static\/css\/pnotify.custom.min.css\"\/&gt;     &lt;link rel=\"stylesheet\" href=\"\/static\/css\/pnotify.css\"\/&gt;     &lt;link rel=\"stylesheet\" href=\"\/static\/css\/pnotify.buttons.css\"\/&gt; &lt;\/head&gt; &lt;body&gt; &lt;div class=\"container\"&gt;     &lt;h1&gt;Authorized page&lt;\/h1&gt;     &lt;br&gt;      &lt;h4&gt;Test auth data&lt;\/h4&gt;     &lt;div id=\"auth_data\"&gt;         #if($!account)             &lt;h4&gt;Hello @$!account.username, You successfully authenticated!&lt;\/h4&gt;             &lt;br&gt;             &lt;button type=\"button\" class=\"btn btn-success btn-logout\"&gt;Logout!&lt;\/button&gt;         #end     &lt;\/div&gt; &lt;\/div&gt;  &lt;script type=\"text\/javascript\" src=\"\/static\/js\/jquery.js\"&gt;&lt;\/script&gt; &lt;script type=\"text\/javascript\" src=\"\/static\/js\/bootstrap.min.js\"&gt;&lt;\/script&gt; &lt;script type=\"text\/javascript\" src=\"\/static\/js\/scripts.js\"&gt;&lt;\/script&gt; &lt;script type=\"text\/javascript\" src=\"\/static\/js\/pnotify.js\"&gt;&lt;\/script&gt; &lt;script type=\"text\/javascript\" src=\"\/static\/js\/pnotify.buttons.js\"&gt;&lt;\/script&gt;  &lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>scripts.js \u2014 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440, \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440<\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">$(function () {     $(\".btn-create\").click(function () {         var cooki = cookie();         document.cookie = 'CSRF-TOKEN=' + cooki;          $.ajax({             url: \"\/signup\",             data: $('#creation').serialize(),             headers: {'X-CSRF-TOKEN': cooki},             crossDomain: true,             xhrFields: {                 withCredentials: true             },             type: \"POST\"         }).done(function (data) {             switch (data.type) {                 case 'OK':                     new PNotify({                         title: 'Success',                         text: data.message,                         type: 'success',                         hide: false                     });                     break;                 case 'ERROR':                     new PNotify({                         title: 'Error',                         text: data.message,                         type: 'error',                         hide: false                     });                     break;             }         });     });      $(\".btn-auth\").click(function () {         var cooki = cookie();         document.cookie = 'CSRF-TOKEN=' + cooki;          $.ajax({             url: \"\/signin\",             data: $('#auth').serialize(),             headers: {'X-CSRF-TOKEN': cooki},             crossDomain: true,             xhrFields: {                 withCredentials: true             },             type: \"POST\"          }).done(function (data) {             switch (data.type) {                 case 'OK':                     new PNotify({                         title: 'Success',                         text: data.message,                         type: 'success',                         hide: false                     });                      setTimeout(function () {                         window.location = \"\/loginPage\";                     }, 5000);                     break;                 case 'ERROR':                     new PNotify({                         title: 'Error',                         text: data.message,                         type: 'error',                         hide: false                     });                     break;             }         });     });      $(\".btn-logout\").click(function () {         $.ajax({             url: \"\/signout\",             crossDomain: true,             xhrFields: {                 withCredentials: true             },             type: \"GET\"         }).done(function (data) {             switch (data.type) {                 case 'OK':                     new PNotify({                         title: 'Success',                         text: 'Logouting...',                         type: 'success',                         hide: false                     });                      setTimeout(function () {                         window.location = data.message;                     }, 5000);                     break;                 case 'ERROR':                     new PNotify({                         title: 'Error',                         text: data.message,                         type: 'error',                         hide: false                     });                     break;             }         });     }); });  function cookie(a) {     return a           \/\/ if the placeholder was passed, return         ? (              \/\/ a random number from 0 to 15             a ^            \/\/ unless b is 8,             Math.random()  \/\/ in which case             * 16           \/\/ a random number from             &gt;&gt; a \/ 4         \/\/ 8 to 11         ).toString(16) \/\/ in hexadecimal         : (              \/\/ or otherwise a concatenated string:             [1e7] +        \/\/ 10000000 +             -1e3 +         \/\/ -1000 +             -4e3 +         \/\/ -4000 +             -8e3 +         \/\/ -80000000 +             -1e11          \/\/ -100000000000,         ).replace(     \/\/ replacing             \/[018]\/g,    \/\/ zeroes, ones, and eights with             cookie           \/\/ random hex digits         ) }<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u0438\u043c, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432\u0441\u0435 \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<br \/>  \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0443\u0432\u0438\u0434\u0438\u043c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041b\u043e\u0433<\/b><\/p>\n<div class=\"spoiler_text\">\n<p>[21.10.18 22:29:51:990] INFO web.model.mapping.MappingContainer: Mapped method [\/], method=[GET], to [public org.ioc.web.model.ModelAndView org.examples.webapp.mapping.MainMapping.index()]<br \/>  [21.10.18 22:29:51:993] INFO web.model.mapping.MappingContainer: Mapped method [\/signup], method=[POST], to [public org.examples.webapp.responces.IMessage org.examples.webapp.mapping.MainMapping.createUser(java.lang.String,java.lang.String,java.lang.String)]<br \/>  [21.10.18 22:29:51:993] INFO web.model.mapping.MappingContainer: Mapped method [\/signin], method=[POST], to [public org.examples.webapp.responces.IMessage org.examples.webapp.mapping.MainMapping.auth(org.ioc.web.model.http.Request,java.lang.String,java.lang.String)]<br \/>  [21.10.18 22:29:51:993] INFO web.model.mapping.MappingContainer: Mapped method [\/signout], method=[GET], to [public org.examples.webapp.responces.IMessage org.examples.webapp.mapping.MainMapping.signout(org.ioc.web.model.http.Request)]<br \/>  [21.10.18 22:29:51:995] INFO web.model.mapping.MappingContainer: Mapped method [\/loginPage], method=[GET], to [public org.ioc.web.model.ModelAndView org.examples.webapp.mapping.MainMapping.authenticated(org.examples.webapp.domain.entity.TblAccount)]<br \/>  [21.10.18 22:29:51:997] INFO ioc.web.factory.HttpInitializerFactory: Http server started on port(s): 8081 (http)<\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<br \/>  1) \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/5f6\/82c\/b5b\/5f682cb5b9760d467ae0a9eebc2071d6.png\" alt=\"index\"><br \/>  2) \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f8c\/3a3\/cf9\/f8c3a3cf90c39df7cf62c4c7dc883dae.png\" alt=\"signup\"><br \/>  3) \u0410\u0443\u0442\u0435\u043d\u0442\u0444\u0438\u043a\u0430\u0446\u0438\u044f<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/a78\/d17\/eab\/a78d17eab431ad573bc512e15f4a85c5.png\" alt=\"auth\"><br \/>  4) \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/d9f\/49d\/16e\/d9f49d16ed269a6e7b1ec8b6fc8e7f5a.png\" alt=\"result\"><br \/>  5) \u041e\u0447\u0438\u0441\u0442\u043a\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0437 \u0441\u0435\u0441\u0438\u0438 \u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/44f\/1af\/f39\/44f1aff39081fd83dc6201ef37b18245.png\" alt=\"image\"><br \/>  6) \u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u043d\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u0435\u0441\u0441\u0438\u0438<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/f42\/e0d\/e0a\/f42e0de0a843023ed417f14c542f5cb4.png\" alt=\"image\"><\/p>\n<p>  <\/p>\n<h2>\u041a\u043e\u043d\u0435\u0446<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0449\u0438\u0439\u0441\u044f, \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f &#171;\u043a\u043e\u043d\u0442\u0440\u0438\u0431\u044c\u044e\u0442\u043e\u0440\u044b&#187; \u0438 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u0434\u0435\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u0434\u043d\u043e\u043c\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0442\u044f\u0436\u0435\u043b\u043e\u0432\u0430\u0442\u043e.<br \/>  <a href=\"https:\/\/github.com\/GenCloud\/ioc_container\">\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a>, \u0442\u0430\u043a \u0436\u0435 \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0438\u043c\u0435\u044e\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <strong>&#8216;examples&#8217;<\/strong>, \u0438 \u043a\u0430\u043a \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c\u0441\u044f, &#171;Good luck, have fun&#187;, \u0432\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/427247\/\"> https:\/\/habr.com\/post\/427247\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/dcd\/618\/78b\/dcd61878b1e937703174d42d5fe7e3eb.png\" alt=\"image\">  <\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0421 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0435\u043b\u0438\u0437\u0430 \u043f\u0440\u043e\u0448\u043b\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 (<a href=\"https:\/\/habr.com\/post\/422857\/\">\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e<\/a>). \u0427\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c?<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0430 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u0446\u0435\u043b\u043e\u043c;<\/li>\n<li>\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043b\u0435\u043d\u0438\u0432\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432;<\/li>\n<li>\u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0435\u0439;<\/li>\n<li>\u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0430\u0441\u043f\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u0434\u043b\u044f \u0441\u0440\u0435\u0434\u043d\u0435\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447, \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0441\u0435 \u0436\u0435 \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u2014 AspectJ \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443)<\/li>\n<li>\u043d\u043e\u0432\u044b\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u0447\u0438\u043a RequestFactory<\/li>\n<\/ul>\n<p>  <\/p>\n<p>**\u041c\u043e\u0434\u0443\u043b\u0438<\/p>\n<p>  <\/p>\n<ul>\n<li>\u043c\u043e\u0434\u0443\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u0435\u0448\u0435\u043c \u043d\u0430 \u0431\u0430\u0437\u0435 EhCache, Guava<\/li>\n<li>\u043c\u043e\u0434\u0443\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u043e\u0442\u043e\u043a\u0430\u043c\u0438 (\u043a\u0430\u043a \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 @SimpleTask, \u0442\u0430\u043a \u0438 \u043f\u0440\u044f\u043c\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0443\u043b\u043e\u043c)<\/li>\n<li>\u043c\u043e\u0434\u0443\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 (\u043b\u0435\u0433\u043a\u043e\u0432\u0435\u0441\u043d\u044b\u0439 ORM \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 JPA, Transactions, NO-SQL Driver \u2014 Orient, Crud methods, repository system \u0438 \u0430\u0432\u0442\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f)<\/li>\n<li>\u043c\u043e\u0434\u0443\u043b\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u0435\u0431-\u043c\u043e\u0440\u0434\u043e\u0439 (\u043c\u0430\u043f\u043f\u0438\u043d\u0433 \u043b\u0438\u043d\u043a\u043e\u0432 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 producers\/consumes, Velocity Template Rendering Page, Basic Security Requests, Sessions, Cookies, SSL) \u043d\u0430 \u0431\u0430\u0437\u0435 Netty 4.1.30.Final<\/li>\n<\/ul>\n<p>  <\/p>\n<p>&#171;\u042d\u0442\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u0432\u0441\u0435 \u0445\u043e\u0440\u043e\u0448\u043e,&#187;- \u0441\u043a\u0430\u0436\u0438\u0442\u0435 \u0412\u044b, -&#171;\u043d\u043e \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0438 \u044d\u0442\u043e \u0432\u0441\u0435?&#187;.<br \/>  &#171;\u0414\u0430, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442&#187;.<\/p>\n<p>  <\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Maven 3 \u0438 Intelijj Idea 2018.2.<\/p>\n<p>  <\/p>\n<p>1) \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438:<\/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-291135","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291135","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=291135"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291135\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=291135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=291135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=291135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}