{"id":226791,"date":"2014-06-19T12:07:03","date_gmt":"2014-06-19T08:07:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=226791"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=226791","title":{"rendered":"<span class=\"post_title\">Spring Security Hello World Java Config<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041f\u0440\u0438\u0432\u0435\u0442 \u0432\u0441\u0435\u043c!<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0435 Spring Security \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c Java Config (\u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 Spring \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f) \u0432\u043c\u0435\u0441\u0442\u043e XML.<\/p>\n<h4>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438<\/h4>\n<p>  <\/p>\n<ul>\n<li>Spring 4.0.5 Release<\/li>\n<li>Spring Boot 1.0.1<\/li>\n<li>Spring Security 3.2.3 Release<\/li>\n<li>Maven <\/li>\n<li>Tomcat 8<\/li>\n<li>Servlet Api 3.1<\/li>\n<li>Java 1.8<\/li>\n<\/ul>\n<p>  \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0432\u0435\u0431 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, Hello World \u043d\u0430 \u0431\u0430\u0437\u0435 Spring MVC \u0438 Spring Security. \u0412\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u044b \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u043e\u043b\u044c\u043a\u043e Java \u043a\u043b\u0430\u0441\u0441\u044b, \u0431\u0435\u0437 \u0435\u0434\u0438\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 XML.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<h4>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u041f\u0440\u043e\u0435\u043a\u0442\u0430.<\/h4>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/56e\/100\/cb6\/56e100cb6e214e9106e98aeb336d3239.png\"\/><\/p>\n<h4>\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 Maven (\u0438\u0437 pom.xml)<\/h4>\n<pre><code class=\"xml\">&lt;dependencies&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;javax.servlet&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;javax.servlet-api&lt;\/artifactId&gt; \t\t\t&lt;version&gt;3.1.0&lt;\/version&gt; \t\t\t&lt;scope&gt;provided&lt;\/scope&gt; \t\t&lt;\/dependency&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;javax.servlet.jsp&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;jsp-api&lt;\/artifactId&gt; \t\t\t&lt;version&gt;2.2&lt;\/version&gt; \t\t\t&lt;scope&gt;provided&lt;\/scope&gt; \t\t&lt;\/dependency&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.springframework&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;spring-context&lt;\/artifactId&gt; \t\t\t&lt;version&gt;4.0.5.RELEASE&lt;\/version&gt; \t\t\t&lt;type&gt;jar&lt;\/type&gt; \t\t&lt;\/dependency&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;4.0.5.RELEASE&lt;\/version&gt; \t\t\t&lt;type&gt;jar&lt;\/type&gt; \t\t&lt;\/dependency&gt;  \t\t&lt;!-- Add Spring Security --&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;3.2.4.RELEASE&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t \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;3.2.4.RELEASE&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;3.2.4.RELEASE&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t\t&lt;!-- Add Jstl Dependencies --&gt; \t\t&lt;dependency&gt; \t\t\t&lt;groupId&gt;org.apache.taglibs&lt;\/groupId&gt; \t\t\t&lt;artifactId&gt;taglibs-standard-jstlel&lt;\/artifactId&gt; \t\t\t&lt;version&gt;1.2.1&lt;\/version&gt; \t\t&lt;\/dependency&gt; \t&lt;\/dependencies&gt; <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440a Spring MVC.<\/p>\n<h4>\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 (<code>AppController.java<\/code>)<\/h4>\n<p>  <\/p>\n<pre><code class=\"java\">package com.elennaro.sshwa.controllers;  \/\/Import section ommited...  @Controller public class AppController {  \t@RequestMapping(value = {&quot;\/&quot;, &quot;\/helloworld**&quot;}, method = {RequestMethod.GET}) \tpublic ModelAndView welcomePage() { \t\tModelAndView model = new ModelAndView(); \t\tmodel.addObject(&quot;title&quot;, &quot;Spring Security Tutorial&quot;); \t\tmodel.addObject(&quot;message&quot;, &quot;Welcome Page !&quot;); \t\tmodel.setViewName(&quot;helloworld&quot;); \t\treturn model; \t}  \t@RequestMapping(value = &quot;\/protected**&quot;, method = RequestMethod.GET) \tpublic ModelAndView protectedPage() {  \t\tModelAndView model = new ModelAndView(); \t\tmodel.addObject(&quot;title&quot;, &quot;Spring Security 3.2.4 Hello World Tutorial&quot;); \t\tmodel.addObject(&quot;message&quot;, &quot;This is protected page - Only for Admin Users!&quot;); \t\tmodel.setViewName(&quot;protected&quot;); \t\treturn model;  \t}  \t@RequestMapping(value = &quot;\/confidential**&quot;, method = RequestMethod.GET) \tpublic ModelAndView adminPage() {  \t\tModelAndView model = new ModelAndView(); \t\tmodel.addObject(&quot;title&quot;, &quot;Spring Security 3.2.4 Hello World Tutorial&quot;); \t\tmodel.addObject(&quot;message&quot;, &quot;This is confidential page - Need Super Admin Role!&quot;); \t\tmodel.setViewName(&quot;protected&quot;);  \t\treturn model;  \t} } <\/code><\/pre>\n<p>  \u0412 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d \u043d\u0435\u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u0438 \u0434\u0432\u0430 \u043f\u0443\u0442\u0438 \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c, \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u0440\u043e\u043b\u044f\u043c\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 (admin) \u0438 \u0441\u0443\u043f\u0435\u0440 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 (superadmin). \u0412\u043e\u0442 \u043f\u0443\u0442\u0438 \u043a \u044d\u0442\u0438\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c:  <\/p>\n<ul>\n<li><b>\/helloword<\/b> \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f, \u043a \u043d\u0435\u043c\u0443 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/li>\n<li><b>\/protected<\/b> \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0449\u0438\u0435 \u0440\u043e\u043b\u044c\u044e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 (admin) \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0435\u0439.<\/li>\n<li><b>\/confidential<\/b> \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c, \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0449\u0438\u0435 \u0440\u043e\u043b\u044c\u044e \u0441\u0443\u043f\u0435\u0440 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0435\u0439.<\/li>\n<\/ul>\n<p>  \u0412 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c <b>\u041c\u043e\u0434\u0435\u043b\u044c<\/b>(\u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 <code>ModelAndView<\/code>). \u0418\u043c\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u043a \u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043c\u043e\u0434\u0435\u043b\u0438. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f (\u0441 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u0438\u044f \u044f \u0431\u0443\u0434\u0443 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u043d\u0430\u0440\u043e\u0434\u043d\u043e \u0432\u044c\u044e\u0448\u043a\u0430\u043c\u0438, \u043e\u0442 \u0430\u043d\u0433\u043b. View) \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a \u0444\u0430\u0439\u043b\u0430\u043c JSP), \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 <code>WebConfig.java<\/code>. \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043d\u0438\u0436\u0435.<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c Spring MVC (WebConfig.java)<\/h4>\n<p>  \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0443 Spring \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0438 \u043a\u0430\u043a \u0438\u0445 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c. \u0422\u0430\u043a \u0436\u0435 \u043d\u0430\u0434\u043e \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u0412\u0441\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Java \u043a\u043b\u0430\u0441\u0441\u0430 \u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <code>@Configuration<\/code> (\u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438).<\/p>\n<p>  <b>WebConfig.java<\/b>  <\/p>\n<pre><code class=\"java\">package com.elennaro.sshwa.config.application;  \/\/Import section ommited...  @Configuration @EnableWebMvc @ComponentScan({ &quot;com.elennaro.sshwa.config&quot;, &quot;com.elennaro.sshwa.controllers&quot; }) \/\/@Import({ AppSecurityConfig.class }) public class WebConfig {   @Bean  public InternalResourceViewResolver viewResolver() {  InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();  viewResolver.setViewClass(JstlView.class);  viewResolver.setPrefix(&quot;\/WEB-INF\/views\/&quot;);  viewResolver.setSuffix(&quot;.jsp&quot;);  return viewResolver;  } } <\/code><\/pre>\n<p>  \u041a\u043e\u0440\u043e\u0442\u043a\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u0434 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435:  <\/p>\n<ul>\n<li>\u041e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 (\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>@Configuration<\/code>).<\/li>\n<li>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>@ComponentScan<\/code> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0443 Spring, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043d\u0430\u0434\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 <code>com.elennaro.sshwa.config<\/code> \u0438 <code>com.elennaro.sshwa.controllers<\/code>. \u0422\u0443\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u044b \u0441\u043e\u0432\u0435\u0442\u0443\u044e\u0442: \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b, \u0430 \u043d\u0435 \u0432\u0441\u0451 \u0441\u0440\u0430\u0437\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>*<\/code>. \u0422\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b: <code>com.elennaro.sshwa.*<\/code> \u0438 \u0432\u0441\u0435 \u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e. \u041d\u043e \u043f\u043e\u044f\u0432\u0438\u0441\u044c \u0443 \u043d\u0430\u0441 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 <code>@ComponentScan<\/code> \u043c\u044b \u0431\u044b \u0432 \u043b\u0443\u0447\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0435\u0440\u0435\u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0432\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0434\u0432\u0430\u0436\u0434\u044b, \u0430 \u0432 \u0445\u0443\u0434\u0448\u0435\u043c \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u043d\u0430 \u043f\u0430\u0440\u0443 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a&#8230;<\/li>\n<li>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0447\u0442\u043e \u0432\u044c\u044e\u0448\u043a\u0438 \u0431\u0443\u0434\u0443\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <code>\/WEB-INF\/views\/<\/code><\/li>\n<li>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0430\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0442\u043e\u0440 Spring Security (\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>@Import({ AppSecurityConfig.class }))<\/code>. \u042d\u0442\u0430 \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0432 \u043a\u043e\u0434\u0435. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043a\u043b\u0430\u0441\u0441 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438(<code>AppSecurityConfig.java<\/code>) \u043e\u0442\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0439 (\u043a\u0430\u043a \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043d\u0438\u0436\u0435) \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <code>@Configuration<\/code> \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0439\u0434\u0435\u043d \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0430\u043f\u043b\u0438\u043a\u0430\u0446\u0438\u0438 Spring \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0443\u0442\u044c \u043a \u043f\u0430\u043a\u0435\u0442\u0443 \u0441\u043e\u0434\u0435\u0440\u0444\u0430\u0449\u0435\u043c\u0443 \u043a\u043b\u0430\u0441\u0441 <code>AppSecurityConfig<\/code> \u0443\u043a\u0430\u0437\u0430\u043d \u0432 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 <code>@ComponentScan<\/code>. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 Spring \u043d\u0430\u0439\u0434\u0435\u0442 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/li>\n<li>\u041e\u0442\u043c\u0435\u0442\u0438\u043c \u0447\u0442\u043e \u0441\u0430\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 <code>AppController.java<\/code> \u0442\u043e\u0436\u0435 \u043f\u043e\u043f\u0430\u0434\u0435\u0442 \u043f\u043e\u0434 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0443\u0442\u044c \u043a \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u043c\u0443 \u0435\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0443 \u0443\u043a\u0430\u0437\u0430\u043d \u0432 <code>@ComponentScan({ &quot;com.elennaro.sshwa.config&quot;, &quot;com.elennaro.sshwa.controllers&quot; })<\/code> \u0438 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f <code>@Controller<\/code> \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<\/li>\n<\/ul>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 Spring Security.<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 (Spring Security \u2014 AppSecurityConfig.java, SecurityInit.java)<\/h4>\n<p>  <b>AppSecurityConfig.java<\/b>  <\/p>\n<pre><code class=\"java\">package com.elennaro.sshwa.config;  \/\/Import section ommited...  @Configuration @EnableWebSecurity public class AppSecurityConfig extends WebSecurityConfigurerAdapter {  \t@Autowired \tpublic void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { \t\tauth.inMemoryAuthentication().withUser(&quot;user&quot;).password(&quot;user&quot;).roles(&quot;USER&quot;); \t\tauth.inMemoryAuthentication().withUser(&quot;admin&quot;).password(&quot;admin&quot;).roles(&quot;ADMIN&quot;); \t\tauth.inMemoryAuthentication().withUser(&quot;superadmin&quot;).password(&quot;superadmin&quot;).roles(&quot;SUPERADMIN&quot;); \t}  \t@Override \tprotected void configure(HttpSecurity http) throws Exception {  \t\thttp.authorizeRequests() \t\t\t\t.antMatchers(&quot;\/protected\/**&quot;).access(&quot;hasRole('ROLE_ADMIN')&quot;) \t\t\t\t.antMatchers(&quot;\/confidential\/**&quot;).access(&quot;hasRole('ROLE_SUPERADMIN')&quot;) \t\t\t\t.and().formLogin().defaultSuccessUrl(&quot;\/&quot;, false);  \t} } <\/code><\/pre>\n<p>  \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0432\u0430\u0436\u043d\u043e\u0439 \u0440\u043e\u043b\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0438\u0433\u0440\u0430\u044e\u0442 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430:  <\/p>\n<ul>\n<li><code>@Configuration<\/code><\/li>\n<li><code>@EnableWebSecurity.<\/code><\/li>\n<\/ul>\n<p>\u0412\u0430\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0442\u043e, \u0447\u0442\u043e \u043e\u043d \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u043a\u043b\u0430\u0441\u0441 <b>WebSecurityConfigurerAdapter<\/b>. <br \/>  \u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f <code>@EnableWebSecurity<\/code> \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 <code>WebSecurityConfigurerAdapter<\/code> \u043a\u043b\u0430\u0441\u0441\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430\u0434 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u0435\u043c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 Spring Security \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b HTTP \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043d\u0430 \u0431\u0430\u0437\u0435 \u0432\u0435\u0431 \u0444\u043e\u0440\u043c. <br \/>  \u041a\u0440\u043e\u043c\u0435 \u0432\u0441\u0435\u0433\u043e, \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441 \u0438\u0445 \u0440\u043e\u043b\u044f\u043c\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u043e \u043f\u043e \u0440\u043e\u043b\u044f\u043c. \u0418\u043c\u0435\u043d\u0430 \u0438 \u043f\u0430\u0440\u043e\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b, \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043f\u0440\u044f\u043c\u043e \u0432 \u043a\u043e\u0434\u0435. Spring Security \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0447\u0442\u043e \u0440\u043e\u043b\u0438 \u0432 \u043c\u0435\u0441\u0442\u0435 \u0433\u0434\u0435 \u043c\u044b \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u0438\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u0431\u0435\u0437 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0430 <code>ROLE_<\/code>, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0438 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <code>access<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044f\u0437\u044b\u043a\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 <b>SPEL<\/b> (Spring Expression Language), \u0437\u0430\u0434\u0430\u0435\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u043e\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <code>hasRole(\u2018ROLE_\u0438\u043c\u044f \u0440\u043e\u043b\u0438\u2019)<\/code>), \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0440\u043e\u043b\u044c \u0441 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u043c <code>ROLE_<\/code>. \u0415\u0449\u0435 \u043e\u0434\u043d\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f \u0445\u0438\u0442\u0440\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438: <code>defaultSuccessUrl(&quot;\/&quot;, false)<\/code>, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 (<code>alwaysUse<\/code>) \u0432 <code>false<\/code> \u0433\u043e\u0432\u043e\u0440\u0438\u0442 Spring Security \u0447\u0442\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0442\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0443, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d \u043f\u0440\u0438\u0448\u0435\u043b \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432 <b>AppSecurityConfig.java<\/b> \u0443 \u043d\u0430\u0441 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0430 \u0432 <b>WebConfig.java<\/b> \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 MVC. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u0438\u0445 \u0443\u0432\u0438\u0434\u0435\u043b \u0438 \u0432\u0442\u044f\u043d\u0443\u043b \u0432 \u0441\u0435\u0431\u044f Root Application Context). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0449\u0438\u0439(\u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439) <b>AbstractAnnotationConfigDispatcherServletInitializer<\/b>. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432\u0441\u0435 \u0442\u0430\u043a \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 URL \u043f\u0430\u0442\u0442\u0435\u0440\u043d (\u043f\u0443\u0442\u044c \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0440\u0435\u0441\u0443\u0440\u0441\u0443) \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b \u0447\u0435\u0440\u0435\u0437 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 (\u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b \u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u043c\u0438 Spring Security). \u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0441\u0435\u0440\u0432\u043b\u0435\u0442 \u0444\u0438\u043b\u044c\u0442\u0440\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438 \u0431\u044b \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u0421 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435\u043c Setvlet 3.x \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u0442\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0432 web.xml, \u0432\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Java \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u041a\u0430\u043a \u0440\u0430\u0437 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d <code>AbstractAnnotationConfigDispatcherServletInitializer<\/code>.<\/p>\n<p>  <b>SecurityInit.java<\/b>  <\/p>\n<pre><code>package com.elennaro.sshwa.config;  \/\/Import section ommited...  public class SecurityInit extends AbstractSecurityWebApplicationInitializer {   } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u0441 XML \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439, \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443:  <\/p>\n<pre><code>&lt;filter&gt;  &lt;filter-name&gt;springSecurityFilterChain&lt;\/filter-name&gt;  &lt;filter-class&gt;  org.springframework.web.filter.DelegatingFilterProxy  &lt;\/filter-class&gt; &lt;\/filter&gt;   &lt;filter-mapping&gt;  &lt;filter-name&gt;springSecurityFilterChain&lt;\/filter-name&gt;  &lt;url-pattern&gt;\/*&lt;\/url-pattern&gt;  &lt;dispatcher&gt;ERROR&lt;\/dispatcher&gt;  &lt;dispatcher&gt;REQUEST&lt;\/dispatcher&gt; &lt;\/filter-mapping&gt; <\/code><\/pre>\n<p>  \u041c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 MVC \u0438 Spring Security. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0414\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440 \u0421\u0435\u0440\u0432\u043b\u0435\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e Spring MVC \u0438 \u043c\u0435\u043f\u043f\u0438\u043d\u0433 URL \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432. \u041e\u043f\u044f\u0442\u044c \u0436\u0435 \u043c\u044b \u043e\u0442\u043a\u0430\u0436\u0435\u043c\u0441\u044f \u043e\u0442 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0414\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0430 \u0421\u0435\u0440\u0432\u043b\u0435\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 web.xml \u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Java \u041a\u043b\u0430\u0441\u0441\u044b.<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0414\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440 \u0421\u0435\u0440\u0432\u043b\u0435\u0442\u0430 (WebAppInitializer.java)<\/h4>\n<p>  <b>WebAppInitializer.java<\/b>  <\/p>\n<pre><code class=\"java\">package com.elennaro.sshwa.config;  \/\/Import section ommited...  public class WebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer{  \t@Override \tprotected Class&lt;?&gt;[] getRootConfigClasses() { \t\treturn new Class[] {WebConfig.class}; \/\/ We dont need any special servlet config yet. \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 } <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b\u0438 \u043c\u044d\u043f\u0438\u043d\u0433 \u0441\u0435\u0440\u0432\u043b\u0435\u0442\u0430 \u043d\u0430 \u201c\/\u201d \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u044b \u0414\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u043e\u043c \u0421\u0435\u0440\u0432\u043b\u0435\u0442\u0430 Spring.<\/p>\n<p>  \u041e\u0442\u043c\u0435\u0442\u0438\u043c \u0447\u0442\u043e, \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 <b>WebAppInitializer.java<\/b> \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 <b>AbstractAnnotationConfigDispatcherservletinitializergetRootConfigClasses<\/b>, \u0437\u0430\u043c\u0435\u0449\u0430\u044f \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434 <code>getRootConfigClasses<\/code> \u0442\u0430\u043a \u0447\u0442\u043e\u0431\u044b \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u043c\u0438 \u043a\u043b\u0430\u0441\u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f <code>WebConfig.class<\/code>. <br \/>  \u0412\u0441\u0435\u2026 \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c, \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u044c\u044e\u0448\u043a\u0438 \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f (\u0412\u044c\u044e\u0448\u043a\u0438)<\/h4>\n<p>  <b>helloworld.jsp<\/b>  <\/p>\n<pre><code>&lt;%@ page language=&quot;java&quot; contentType=&quot;text\/html; charset=UTF-8&quot; pageEncoding=&quot;UTF-8&quot;%&gt;  &lt;html&gt; \t&lt;head&gt; \t\t&lt;base href=&quot;${pageContext.request.scheme}:\/\/${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}\/&quot; \/&gt; \t\t&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text\/html; charset=UTF-8&quot;&gt; \t\t&lt;title&gt;Hello World&lt;\/title&gt; \t&lt;\/head&gt; \t&lt;body&gt; \t\t&lt;header&gt; \t\t\t&lt;h1&gt;Title : ${title}&lt;\/h1&gt; \t\t&lt;\/header&gt; \t\t&lt;section&gt; \t\t\t&lt;h1&gt;Message : ${message}&lt;\/h1&gt; \t\t&lt;\/section&gt; \t\t&lt;div&gt;Get &lt;a href=&quot;protected&quot;&gt;protected&lt;\/a&gt; resource for admin.&lt;\/div&gt; \t\t&lt;div&gt;Get &lt;a href=&quot;confidential&quot;&gt;confidential&lt;\/a&gt; resource for superadmin.&lt;\/div&gt; \t\t&lt;footer&gt; \t\t\t&lt;div&gt;Updated by Alex Art from &lt;a href=&quot;https:\/\/in2circle.com&quot; target=&quot;_blank&quot;&gt;in2circle.com&lt;\/a&gt;&lt;\/div&gt; \t\t&lt;\/footer&gt; \t&lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  <b>protected.jsp<\/b>  <\/p>\n<pre><code>&lt;%@ page isELIgnored=&quot;false&quot; %&gt; &lt;%@ page language=&quot;java&quot; contentType=&quot;text\/html; charset=UTF-8&quot; \t\t\t\t pageEncoding=&quot;UTF-8&quot;%&gt; &lt;%@ taglib prefix=&quot;c&quot; uri=&quot;http:\/\/java.sun.com\/jsp\/jstl\/core&quot; %&gt; &lt;html&gt; \t&lt;head&gt;\t \t\t&lt;base href=&quot;${pageContext.request.scheme}:\/\/${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}\/&quot; \/&gt; \t\t&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text\/html; charset=UTF-8&quot;&gt; \t\t&lt;title&gt;Protected page&lt;\/title&gt; \t&lt;\/head&gt; \t&lt;body&gt; \t\t&lt;h1&gt;Title : ${title}&lt;\/h1&gt; \t\t&lt;h1&gt;Message : ${message}&lt;\/h1&gt;  \t\t&lt;c:if test=&quot;${pageContext.request.userPrincipal.name != null}&quot;&gt; \t\t\t&lt;h2&gt;Welcome : ${pageContext.request.userPrincipal.name} \t\t\t\t| &lt;c:url value=&quot;login?logout&quot; var=&quot;logoutUrl&quot; \/&gt; \t\t\t\t&lt;a href=&quot;${logoutUrl}&quot;&gt;Log Out&lt;\/a&gt; \t\t\t&lt;\/c:if&gt; \t\t&lt;\/h2&gt; \t\t&lt;div&gt;Get &lt;a href=&quot;protected&quot;&gt;protected&lt;\/a&gt; resource for admin.&lt;\/div&gt; \t\t&lt;div&gt;Get &lt;a href=&quot;confidential&quot;&gt;confidential&lt;\/a&gt; resource for superadmin.&lt;\/div&gt; \t\t&lt;footer&gt; \t\t\t&lt;div&gt;Updated by Alex Art from &lt;a href=&quot;https:\/\/in2circle.com&quot; target=&quot;_blank&quot;&gt;in2circle.com&lt;\/a&gt;&lt;\/div&gt; \t\t&lt;\/footer&gt; \t&lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u043a\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 logout URL: <code>login?logout<\/code>.<br \/>  Spring Security, \u0441\u0430\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 login.<\/p>\n<h4>\u0424\u0438\u043d\u0438\u0448.<\/h4>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435: <b><a href=\"http:\/\/localhost:8080\/sshwa\/helloworld\/\">http:\/\/localhost:8080\/sshwa\/helloworld\/<\/a><\/b><\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/889\/05c\/f08\/88905cf08eab6bd6c90cd6506741aba5.png\"\/><\/p>\n<p>  \u041a\u0430\u043a \u043c\u044b \u0438 \u0445\u043e\u0442\u0435\u043b\u0438 \u0440\u0435\u0441\u0443\u0440\u0441 <b>\/helloworld<\/b> \u043d\u0435\u0437\u0430\u0449\u0438\u0449\u0435\u043d<br \/>  \u041a\u043e\u0433\u0434\u0430 \u0436\u0435 \u043c\u044b \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u043c URL \u043d\u0430 <b><a href=\"http:\/\/localhost:8080\/sshwa\/protected\/\">http:\/\/localhost:8080\/sshwa\/protected\/<\/a><\/b> Spring Security \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442 \u043d\u0430\u0441 \u043d\u0430 <b>\/login<\/b>, \u0441 \u0444\u043e\u0440\u043c\u043e\u0439 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0415\u0441\u043b\u0438 \u043c\u044b \u0432\u0432\u0435\u0434\u0435\u043c \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0435 \u043b\u043e\u0433\u0438\u043d \u0438\u043b\u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445, \u0438 Spring \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442 \u043d\u0430 URL <b>\/login?error<\/b>.<br \/>  \u0414\u043b\u044f \u043d\u0435\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 Spring \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u043a\u0438\u043d\u0435\u0442 \u043d\u0430\u0441 \u0432 root (&quot;\/&quot;), \u0430 \u043f\u0440\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0437\u0430\u0439\u0442\u0438 \u043d\u0430 \u0440\u0435\u0441\u0443\u0440\u0441 \u0441 \u043d\u0435\u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0439 \u0440\u043e\u043b\u044c\u044e, \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0443 \u0441 \u043a\u043e\u0434\u043e\u043c <b>403<\/b>.<\/p>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443:<br \/>  <a href=\"https:\/\/github.com\/elennaro\/sshwa\/tree\/0.2-SNAPSHOT\">github.com\/elennaro\/sshwa\/tree\/0.2-SNAPSHOT<\/a><\/p>\n<p>  \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0443 \u043c\u0435\u043d\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b (\u0432 \u043f\u043b\u0430\u043d\u0430\u0445 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0432\u0441\u0435 \u043d\u0430 Spring Boot, \u0430 \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0439\u0434\u0435\u0442 Spring Security 4.0 Release \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u044b).<\/p>\n<p>  \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430 \u0438\u0437 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430: <a href=\"http:\/\/javahash.com\/spring-security-hello-world-example\/\">javahash.com\/spring-security-hello-world-example\/<\/a>. \u041a\u043e\u0434 \u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u0430\u043d, \u0442\u0435\u043a\u0441\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d \u043a\u0430\u0436\u0443\u0449\u0438\u043c\u0438\u0441\u044f \u043c\u043d\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c\u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438.<\/p>\n<p>  \u042d\u0442\u043e \u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b, \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0443\u0447\u0435\u0441\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0436\u0435\u043b\u0430\u043d\u0438\u044f \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f. \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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\/226791\/\"> http:\/\/habrahabr.ru\/post\/226791\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041f\u0440\u0438\u0432\u0435\u0442 \u0432\u0441\u0435\u043c!<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0435 Spring Security \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c Java Config (\u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 Spring \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f) \u0432\u043c\u0435\u0441\u0442\u043e XML.<\/p>\n<h4>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438<\/h4>\n<p>  <\/p>\n<ul>\n<li>Spring 4.0.5 Release<\/li>\n<li>Spring Boot 1.0.1<\/li>\n<li>Spring Security 3.2.3 Release<\/li>\n<li>Maven <\/li>\n<li>Tomcat 8<\/li>\n<li>Servlet Api 3.1<\/li>\n<li>Java 1.8<\/li>\n<\/ul>\n<p>  \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0432\u0435\u0431 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, Hello World \u043d\u0430 \u0431\u0430\u0437\u0435 Spring MVC \u0438 Spring Security. \u0412\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u044b \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u043e\u043b\u044c\u043a\u043e Java \u043a\u043b\u0430\u0441\u0441\u044b, \u0431\u0435\u0437 \u0435\u0434\u0438\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 XML.<\/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-226791","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/226791","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=226791"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/226791\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=226791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=226791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=226791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}