{"id":1194,"date":"2020-06-25T10:59:54","date_gmt":"2020-06-25T01:59:54","guid":{"rendered":"https:\/\/ito-u-oti.com\/?p=1194"},"modified":"2020-06-25T11:00:07","modified_gmt":"2020-06-25T02:00:07","slug":"post-1194","status":"publish","type":"post","link":"https:\/\/ito-u-oti.com\/?p=1194","title":{"rendered":"\u3010SpringBoot\u3011Interceptor\u3067Header\u60c5\u5831\u3092\u53d7\u3051\u53d6\u308a\u3001Service\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b"},"content":{"rendered":"\n<p>Header\u60c5\u5831\u3092Controller\u306eIF\u90e8\u5206\u3067\u53d7\u3051\u53d6\u308c\u3070\u3001\u666e\u901a\u306b\u5f8c\u7d9a\u306eService\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001\u4eca\u56de\u306fController\u3067Header\u60c5\u5831\u3092\u53d7\u3051\u53d6\u3089\u305a\u306b\u3001\u5225\u306e\u5834\u6240\u3067Header\u60c5\u5831\u3092\u683c\u7d0d\u3057\u3066\u5f8c\u7d9a\u51e6\u7406\u3067\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>Spring\u306e\u6a5f\u80fd\u3067\u3042\u308bInterceptor\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 id=\"outline__1\" class=\"wp-block-heading\">Interceptor\u3068\u306f<\/h2>\n\n\n\n<p>API\u304c\u547c\u3070\u308c\u305f\u6642\u306b\u3001Controller\u304c\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u53d6\u3063\u3066\u51e6\u7406\u3092\u958b\u59cb\u3059\u308b\u524d\u306b\u3001\u4efb\u610f\u306e\u51e6\u7406\u3092\u631f\u3080\u3053\u3068\u304c\u3067\u304d\u308bSpring\u306e\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p><a href=\"https:\/\/qiita.com\/kazuki43zoo\/items\/757b557c05f548c6c5db#handlerinterceptor\" title=\"https:\/\/qiita.com\/kazuki43zoo\/items\/757b557c05f548c6c5db#handlerinterceptor\">Quita\u306e\u8a18\u4e8b<\/a>\u3067\u5206\u304b\u308a\u3084\u3059\u3044\u8aac\u660e\u304c\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>Interceptor\u306e\u4e3b\u306a\u7528\u9014\u3068\u3057\u3066\u306f\u3001\u300c\u51e6\u7406\u306e\u524d\u5f8c\u306b\u958b\u59cb\u30fb\u7d42\u4e86\u306e\u30ed\u30b0\u3092\u631f\u3080\u300d\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u6a5f\u80fd\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001Controller\u304b\u3089\u51e6\u7406\u304c\u59cb\u307e\u308b\u524d\u306bHeader\u60c5\u5831\u3092\u53d7\u3051\u53d6\u3063\u3066\u683c\u7d0d\u3001Controller\u4ee5\u964d\u306e\u51e6\u7406\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h2 id=\"outline__2\" class=\"wp-block-heading\">Interceptor\u306e\u5b9f\u88c5<\/h2>\n\n\n\n<h3 id=\"outline__2_1\" class=\"wp-block-heading\">HiddenHeaderInterceptor.java<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\n@RequiredArgsConstructor\npublic class HideHeaderInterceptor  extends HandlerInterceptorAdapter {\n\n    private final HideHeader hideHeader;\n\n    @Override\n    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)\n            throws Exception {\n        String headerValue = request.getHeader(&quot;hide-header&quot;);\n        if(headerValue != null){\n            hideHeader.setHideHeaderValue(headerValue);\n        }\n        return true;\n    }\n}\n<\/pre><\/div>\n\n\n<p>\u30ea\u30af\u30a8\u30b9\u30c8\u304b\u3089\u30d8\u30c3\u30c0\u30fc\u60c5\u5831\u3092\u629c\u3044\u3066\u3001DI\u3057\u3066\u3044\u308bBean\u306e\u9805\u76ee\u306b\u8a2d\u5b9a\u3057\u3066\u307e\u3059\u3002<\/p>\n\n\n\n<h3 id=\"outline__2_2\" class=\"wp-block-heading\">HideHeader.java<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\n@Data\npublic class HideHeader {\n\n    private String hideHeaderValue = null;\n\n}\n<\/pre><\/div>\n\n\n<h3 id=\"outline__2_3\" class=\"wp-block-heading\">WebMvcConfig.java<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\n\/**\n * Spring webMvc Configuration\n *\/\n\n@Slf4j\n@Configuration\npublic class WebMvcConfig implements WebMvcConfigurer {\n\n    @Override\n    public void addInterceptors(InterceptorRegistry registry) {\n        registry.addInterceptor(hideHeaderInterceptor());\n    }\n\n    @Bean\n    HideHeaderInterceptor hideHeaderInterceptor() {\n        return new HideHeaderInterceptor(hideHeader());\n    }\n\n    @Bean\n    HideHeader hideHeader() {\n        return new HideHeader();\n    }\n}\n<\/pre><\/div>\n\n\n<p>Config\u3067\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068Interceptor\u306e\u767b\u9332\u3092\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 id=\"outline__3\" class=\"wp-block-heading\">DI\u306e\u30b9\u30b3\u30fc\u30d7\u306b\u3064\u3044\u3066\u6ce8\u610f<\/h2>\n\n\n\n<p>\u3053\u3053\u3067\u4e00\u3064\u6ce8\u610f\u306a\u306e\u304c\u3001\u3053\u306e\u307e\u307e\u3060\u3068HideHeader\u306e\u30e9\u30a4\u30d5\u30b5\u30a4\u30af\u30eb\u304cSingleton\u3068\u306a\u308a\u3001Spring\u306e\u4e2d\u3067\u4f7f\u3044\u307e\u308f\u3055\u308c\u308b\u306e\u3067\u524d\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306eHeader\u60c5\u5831\u304c\u305d\u306e\u307e\u307e\u4f7f\u3048\u3066\u3057\u307e\u3046\u3068\u3044\u3046\u554f\u984c\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3092\u9632\u3050\u305f\u3081\u306bBean\u3078\u306e\u767b\u9332\u3059\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30e9\u30a4\u30d5\u30b5\u30a4\u30af\u30eb\u3092\u30ea\u30af\u30a8\u30b9\u30c8\u6bce\u306b\u884c\u3046\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u3042\u3052\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\n    @Bean\n    @Scope(&quot;request&quot;)\n    HideHeader hideHeader() {\n        return new HideHeader();\n    }\n<\/pre><\/div>\n\n\n<p>\u30ea\u30af\u30a8\u30b9\u30c8\u6bce\u306b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u751f\u6210\u3055\u308c\u3001Header\u60c5\u5831\u304c\u6bce\u56de\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 id=\"outline__3_1\" class=\"wp-block-heading\">Exception\u304c\u767a\u751f\u3059\u308b<\/h3>\n\n\n\n<p>\u4e0a\u306e\u8a2d\u5b9a\u3092\u884c\u3046\u3068\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\njava.lang.IllegalStateException: Failed to load ApplicationContext\n\n\tat org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:125)\n\tat org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:108)\n\tat org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:118)\n\tat org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)\n\tat org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance(SpringBootDependencyInjectionTestExecutionListener.java:44)\n\tat org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:246)\n\tat org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:97)\n\tat org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$invokeTestInstancePostProcessors$5(ClassTestDescriptor.java:349)\n\tat org.junit.jupiter.engine.descriptor.JupiterTestDescriptor.executeAndMaskThrowable(JupiterTestDescriptor.java:215)\n\tat org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$invokeTestInstancePostProcessors$6(ClassTestDescriptor.java:349)\n\tat java.base\/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)\n\tat java.base\/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)\n\tat java.base\/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654)\n\tat java.base\/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)\n\tat java.base\/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)\n\tat java.base\/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312)\n\tat java.base\/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735)\n\tat java.base\/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)\n\tat java.base\/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)\n\tat org.junit.jupiter.engine.descriptor.ClassTestDescriptor.invokeTestInstancePostProcessors(ClassTestDescriptor.java:348)\n\tat org.junit.jupiter.engine.descriptor.ClassTestDescriptor.instantiateAndPostProcessTestInstance(ClassTestDescriptor.java:270)\n\tat org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$testInstanceProvider$2(ClassTestDescriptor.java:259)\n\tat org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$testInstanceProvider$3(ClassTestDescriptor.java:263)\n\tat java.base\/java.util.Optional.orElseGet(Optional.java:369)\n\tat org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$testInstanceProvider$4(ClassTestDescriptor.java:262)\n\tat org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:82)\n\tat org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:59)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$0(NodeTestTask.java:83)\n\tat org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:83)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:69)\n\tat java.base\/java.util.ArrayList.forEach(ArrayList.java:1540)\n\tat org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$4(NodeTestTask.java:112)\n\tat org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:98)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:74)\n\tat java.base\/java.util.ArrayList.forEach(ArrayList.java:1540)\n\tat org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$4(NodeTestTask.java:112)\n\tat org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:72)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:98)\n\tat org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:74)\n\tat org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)\n\tat org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)\n\tat org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)\n\tat org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)\n\tat org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)\n\tat org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)\n\tat org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)\n\tat org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)\n\tat com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:69)\n\tat com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)\n\tat com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)\n\tat com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)\nCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hideHeaderInterceptor' defined in class path resource &#x5B;com\/example\/demo\/WebMvcConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate &#x5B;com.example.demo.interceptor.HideHeaderInterceptor]: Factory method 'hideHeaderInterceptor' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hideHeader': Scope 'request' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.\n\tat org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627)\n\tat org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:456)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1305)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1144)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)\n\tat org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)\n\tat org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)\n\tat org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:849)\n\tat org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)\n\tat org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)\n\tat org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)\n\tat org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)\n\tat org.springframework.boot.SpringApplication.run(SpringApplication.java:316)\n\tat org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:127)\n\tat org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99)\n\tat org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:117)\n\t... 54 more\nCaused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate &#x5B;com.example.demo.interceptor.HideHeaderInterceptor]: Factory method 'hideHeaderInterceptor' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hideHeader': Scope 'request' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.\n\tat org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)\n\tat org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622)\n\t... 72 more\nCaused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hideHeader': Scope 'request' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:365)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)\n\tat org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.resolveBeanReference(ConfigurationClassEnhancer.java:394)\n\tat org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:366)\n\tat com.example.demo.WebMvcConfig$$EnhancerBySpringCGLIB$$72265a29.hideHeader(&amp;lt;generated&gt;)\n\tat com.example.demo.WebMvcConfig.hideHeaderInterceptor(WebMvcConfig.java:27)\n\tat com.example.demo.WebMvcConfig$$EnhancerBySpringCGLIB$$72265a29.CGLIB$hideHeaderInterceptor$1(&amp;lt;generated&gt;)\n\tat com.example.demo.WebMvcConfig$$EnhancerBySpringCGLIB$$72265a29$$FastClassBySpringCGLIB$$a57f7209.invoke(&amp;lt;generated&gt;)\n\tat org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)\n\tat org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363)\n\tat com.example.demo.WebMvcConfig$$EnhancerBySpringCGLIB$$72265a29.hideHeaderInterceptor(&amp;lt;generated&gt;)\n\tat java.base\/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat java.base\/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat java.base\/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.base\/java.lang.reflect.Method.invoke(Method.java:567)\n\tat org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)\n\t... 73 more\nCaused by: java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.\n\tat org.springframework.web.context.request.RequestContextHolder.currentRequestAttributes(RequestContextHolder.java:131)\n\tat org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:42)\n\tat org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:353)\n\t... 88 more\n<\/pre><\/div>\n\n\n<p>\u3053\u308c\u306f\u3001Spring\u306eBean\u306e\u30e9\u30a4\u30d5\u30b5\u30a4\u30af\u30eb\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u3067Singleton\u306a\u306e\u306b\u5bfe\u3057\u3066\u3001\u305d\u308c\u3088\u308a\u3082\u77ed\u3044\u30e9\u30a4\u30d5\u30b5\u30a4\u30af\u30eb\uff08\u30ea\u30af\u30a8\u30b9\u30c8\u6bce\uff09\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u767b\u9332\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u305f\u3081\u8d77\u3053\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3092\u56de\u907f\u3059\u308b\u305f\u3081\u306b\u3001Scope\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306e\u8a2d\u5b9a\u3092\u5909\u3048\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: java; title: ; notranslate\" title=\"\">\n    @Scope(value = WebApplicationContext.SCOPE_REQUEST,proxyMode = ScopedProxyMode.TARGET_CLASS)\n    HideHeader hideHeader() {\n        return new HideHeader();\n    }\n<\/pre><\/div>\n\n\n<h2 id=\"outline__4\" class=\"wp-block-heading\">\u53c2\u8003<\/h2>\n\n\n\n<p><a href=\"https:\/\/qiita.com\/kazuki43zoo\/items\/757b557c05f548c6c5db#spring%E6%8F%90%E4%BE%9B%E3%81%AEhandlerinterceptor%E3%81%AE%E5%AE%9F%E8%A3%85%E3%82%AF%E3%83%A9%E3%82%B9\">Spring MVC(+Spring Boot)\u4e0a\u3067\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u5171\u901a\u51e6\u7406\u306e\u5b9f\u88c5\u65b9\u6cd5\u3092\u7406\u89e3\u3059\u308b<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kazuhira-r.hatenablog.com\/entry\/20151001\/1443710113\">Spring\u306eSingleton\u306a\u7ba1\u7406Bean\u306b\u3001\u81ea\u5206\u3088\u308a\u77ed\u3044\u30e9\u30a4\u30d5\u30b5\u30a4\u30af\u30eb\u306eBean\u3092DI\u3057\u3088\u3046\u3068\u3059\u308b\u3068\uff1f<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Header\u60c5\u5831\u3092Controller\u306eIF\u90e8\u5206\u3067\u53d7\u3051\u53d6\u308c\u3070\u3001\u666e\u901a\u306b\u5f8c\u7d9a\u306eService\u5c64\u306a\u3069\u3067\u4f7f\u7528 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1197,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[275,238],"class_list":["post-1194","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring","tag-interceptor","tag-spring-boot"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"Header\u60c5\u5831\u3092Controller\u306eIF\u90e8\u5206\u3067\u53d7\u3051\u53d6\u308c\u3070\u3001\u666e\u901a\u306b\u5f8c\u7d9a\u306eService\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"\u3044\u3068\u3068\u3044\"\/>\n\t<meta name=\"google-site-verification\" content=\"dHfPMd0QGg17gHdKjRsKPMBchJp5FPXghry3uflwfwM\" \/>\n\t<meta name=\"keywords\" content=\"spring boot,interceptor\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/ito-u-oti.com\/?p=1194\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"ja_JP\" \/>\n\t\t<meta property=\"og:site_name\" content=\"\u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\u3010SpringBoot\u3011Interceptor\u3067Header\u60c5\u5831\u3092\u53d7\u3051\u53d6\u308a\u3001Service\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1\" \/>\n\t\t<meta property=\"og:description\" content=\"Header\u60c5\u5831\u3092Controller\u306eIF\u90e8\u5206\u3067\u53d7\u3051\u53d6\u308c\u3070\u3001\u666e\u901a\u306b\u5f8c\u7d9a\u306eService\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/ito-u-oti.com\/?p=1194\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2020\/06\/spring-boot-logo.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2020\/06\/spring-boot-logo.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-06-25T01:59:54+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-06-25T02:00:07+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"\u3010SpringBoot\u3011Interceptor\u3067Header\u60c5\u5831\u3092\u53d7\u3051\u53d6\u308a\u3001Service\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Header\u60c5\u5831\u3092Controller\u306eIF\u90e8\u5206\u3067\u53d7\u3051\u53d6\u308c\u3070\u3001\u666e\u901a\u306b\u5f8c\u7d9a\u306eService\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@itouoti_IoT\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2020\/06\/spring-boot-logo.jpg\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1194#article\",\"name\":\"\\u3010SpringBoot\\u3011Interceptor\\u3067Header\\u60c5\\u5831\\u3092\\u53d7\\u3051\\u53d6\\u308a\\u3001Service\\u5c64\\u306a\\u3069\\u3067\\u4f7f\\u7528\\u3059\\u308b | \\u30f0\\u5200\\u306e\\u304a\\u3082\\u3061\\u3083\\u7bb1\",\"headline\":\"\\u3010SpringBoot\\u3011Interceptor\\u3067Header\\u60c5\\u5831\\u3092\\u53d7\\u3051\\u53d6\\u308a\\u3001Service\\u5c64\\u306a\\u3069\\u3067\\u4f7f\\u7528\\u3059\\u308b\",\"author\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?author=1#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/spring-boot-logo.jpg\",\"width\":300,\"height\":300},\"datePublished\":\"2020-06-25T10:59:54+09:00\",\"dateModified\":\"2020-06-25T11:00:07+09:00\",\"inLanguage\":\"ja\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1194#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1194#webpage\"},\"articleSection\":\"spring, Interceptor, spring boot\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1194#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com#listItem\",\"position\":1,\"name\":\"\\u30db\\u30fc\\u30e0\",\"item\":\"https:\\\/\\\/ito-u-oti.com\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=6#listItem\",\"name\":\"\\u30d7\\u30ed\\u30b0\\u30e9\\u30df\\u30f3\\u30b0\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=6#listItem\",\"position\":2,\"name\":\"\\u30d7\\u30ed\\u30b0\\u30e9\\u30df\\u30f3\\u30b0\",\"item\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=6\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=24#listItem\",\"name\":\"spring\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com#listItem\",\"name\":\"\\u30db\\u30fc\\u30e0\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=24#listItem\",\"position\":3,\"name\":\"spring\",\"item\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=24\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1194#listItem\",\"name\":\"\\u3010SpringBoot\\u3011Interceptor\\u3067Header\\u60c5\\u5831\\u3092\\u53d7\\u3051\\u53d6\\u308a\\u3001Service\\u5c64\\u306a\\u3069\\u3067\\u4f7f\\u7528\\u3059\\u308b\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=6#listItem\",\"name\":\"\\u30d7\\u30ed\\u30b0\\u30e9\\u30df\\u30f3\\u30b0\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1194#listItem\",\"position\":4,\"name\":\"\\u3010SpringBoot\\u3011Interceptor\\u3067Header\\u60c5\\u5831\\u3092\\u53d7\\u3051\\u53d6\\u308a\\u3001Service\\u5c64\\u306a\\u3069\\u3067\\u4f7f\\u7528\\u3059\\u308b\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?cat=24#listItem\",\"name\":\"spring\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/#person\",\"name\":\"\\u3044\\u3068\\u3068\\u3044\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1194#personImage\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/wp-content\\\/uploads\\\/2021\\\/06\\\/IMG_20191231_122527_095-150x150.jpg\",\"width\":96,\"height\":96,\"caption\":\"\\u3044\\u3068\\u3068\\u3044\"},\"sameAs\":[\"https:\\\/\\\/twitter.com\\\/itouoti_IoT\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?author=1#author\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/?author=1\",\"name\":\"\\u3044\\u3068\\u3068\\u3044\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1194#authorImage\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/wp-content\\\/uploads\\\/2021\\\/06\\\/IMG_20191231_122527_095-150x150.jpg\",\"width\":96,\"height\":96,\"caption\":\"\\u3044\\u3068\\u3068\\u3044\"},\"sameAs\":[\"https:\\\/\\\/twitter.com\\\/itouoti_IoT\"]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1194#webpage\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1194\",\"name\":\"\\u3010SpringBoot\\u3011Interceptor\\u3067Header\\u60c5\\u5831\\u3092\\u53d7\\u3051\\u53d6\\u308a\\u3001Service\\u5c64\\u306a\\u3069\\u3067\\u4f7f\\u7528\\u3059\\u308b | \\u30f0\\u5200\\u306e\\u304a\\u3082\\u3061\\u3083\\u7bb1\",\"description\":\"Header\\u60c5\\u5831\\u3092Controller\\u306eIF\\u90e8\\u5206\\u3067\\u53d7\\u3051\\u53d6\\u308c\\u3070\\u3001\\u666e\\u901a\\u306b\\u5f8c\\u7d9a\\u306eService\\u5c64\\u306a\\u3069\\u3067\\u4f7f\\u7528\\u3059\\u308b\\u3053\\u3068\\u304c\",\"inLanguage\":\"ja\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1194#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?author=1#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?author=1#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/spring-boot-logo.jpg\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1194\\\/#mainImage\",\"width\":300,\"height\":300},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/?p=1194#mainImage\"},\"datePublished\":\"2020-06-25T10:59:54+09:00\",\"dateModified\":\"2020-06-25T11:00:07+09:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/#website\",\"url\":\"https:\\\/\\\/ito-u-oti.com\\\/\",\"name\":\"\\u30f0\\u5200\\u306e\\u304a\\u3082\\u3061\\u3083\\u7bb1\",\"description\":\"music\\u00d7IT\\u00d7guiter\\u00d7programing\",\"inLanguage\":\"ja\",\"publisher\":{\"@id\":\"https:\\\/\\\/ito-u-oti.com\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\u3010SpringBoot\u3011Interceptor\u3067Header\u60c5\u5831\u3092\u53d7\u3051\u53d6\u308a\u3001Service\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","description":"Header\u60c5\u5831\u3092Controller\u306eIF\u90e8\u5206\u3067\u53d7\u3051\u53d6\u308c\u3070\u3001\u666e\u901a\u306b\u5f8c\u7d9a\u306eService\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c","canonical_url":"https:\/\/ito-u-oti.com\/?p=1194","robots":"max-image-preview:large","keywords":"spring boot,interceptor","webmasterTools":{"google-site-verification":"dHfPMd0QGg17gHdKjRsKPMBchJp5FPXghry3uflwfwM","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ito-u-oti.com\/?p=1194#article","name":"\u3010SpringBoot\u3011Interceptor\u3067Header\u60c5\u5831\u3092\u53d7\u3051\u53d6\u308a\u3001Service\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","headline":"\u3010SpringBoot\u3011Interceptor\u3067Header\u60c5\u5831\u3092\u53d7\u3051\u53d6\u308a\u3001Service\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b","author":{"@id":"https:\/\/ito-u-oti.com\/?author=1#author"},"publisher":{"@id":"https:\/\/ito-u-oti.com\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2020\/06\/spring-boot-logo.jpg","width":300,"height":300},"datePublished":"2020-06-25T10:59:54+09:00","dateModified":"2020-06-25T11:00:07+09:00","inLanguage":"ja","mainEntityOfPage":{"@id":"https:\/\/ito-u-oti.com\/?p=1194#webpage"},"isPartOf":{"@id":"https:\/\/ito-u-oti.com\/?p=1194#webpage"},"articleSection":"spring, Interceptor, spring boot"},{"@type":"BreadcrumbList","@id":"https:\/\/ito-u-oti.com\/?p=1194#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com#listItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/ito-u-oti.com","nextItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=6#listItem","name":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0"}},{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=6#listItem","position":2,"name":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0","item":"https:\/\/ito-u-oti.com\/?cat=6","nextItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=24#listItem","name":"spring"},"previousItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com#listItem","name":"\u30db\u30fc\u30e0"}},{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=24#listItem","position":3,"name":"spring","item":"https:\/\/ito-u-oti.com\/?cat=24","nextItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?p=1194#listItem","name":"\u3010SpringBoot\u3011Interceptor\u3067Header\u60c5\u5831\u3092\u53d7\u3051\u53d6\u308a\u3001Service\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b"},"previousItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=6#listItem","name":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0"}},{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?p=1194#listItem","position":4,"name":"\u3010SpringBoot\u3011Interceptor\u3067Header\u60c5\u5831\u3092\u53d7\u3051\u53d6\u308a\u3001Service\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b","previousItem":{"@type":"ListItem","@id":"https:\/\/ito-u-oti.com\/?cat=24#listItem","name":"spring"}}]},{"@type":"Person","@id":"https:\/\/ito-u-oti.com\/#person","name":"\u3044\u3068\u3068\u3044","image":{"@type":"ImageObject","@id":"https:\/\/ito-u-oti.com\/?p=1194#personImage","url":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2021\/06\/IMG_20191231_122527_095-150x150.jpg","width":96,"height":96,"caption":"\u3044\u3068\u3068\u3044"},"sameAs":["https:\/\/twitter.com\/itouoti_IoT"]},{"@type":"Person","@id":"https:\/\/ito-u-oti.com\/?author=1#author","url":"https:\/\/ito-u-oti.com\/?author=1","name":"\u3044\u3068\u3068\u3044","image":{"@type":"ImageObject","@id":"https:\/\/ito-u-oti.com\/?p=1194#authorImage","url":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2021\/06\/IMG_20191231_122527_095-150x150.jpg","width":96,"height":96,"caption":"\u3044\u3068\u3068\u3044"},"sameAs":["https:\/\/twitter.com\/itouoti_IoT"]},{"@type":"WebPage","@id":"https:\/\/ito-u-oti.com\/?p=1194#webpage","url":"https:\/\/ito-u-oti.com\/?p=1194","name":"\u3010SpringBoot\u3011Interceptor\u3067Header\u60c5\u5831\u3092\u53d7\u3051\u53d6\u308a\u3001Service\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","description":"Header\u60c5\u5831\u3092Controller\u306eIF\u90e8\u5206\u3067\u53d7\u3051\u53d6\u308c\u3070\u3001\u666e\u901a\u306b\u5f8c\u7d9a\u306eService\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c","inLanguage":"ja","isPartOf":{"@id":"https:\/\/ito-u-oti.com\/#website"},"breadcrumb":{"@id":"https:\/\/ito-u-oti.com\/?p=1194#breadcrumblist"},"author":{"@id":"https:\/\/ito-u-oti.com\/?author=1#author"},"creator":{"@id":"https:\/\/ito-u-oti.com\/?author=1#author"},"image":{"@type":"ImageObject","url":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2020\/06\/spring-boot-logo.jpg","@id":"https:\/\/ito-u-oti.com\/?p=1194\/#mainImage","width":300,"height":300},"primaryImageOfPage":{"@id":"https:\/\/ito-u-oti.com\/?p=1194#mainImage"},"datePublished":"2020-06-25T10:59:54+09:00","dateModified":"2020-06-25T11:00:07+09:00"},{"@type":"WebSite","@id":"https:\/\/ito-u-oti.com\/#website","url":"https:\/\/ito-u-oti.com\/","name":"\u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","description":"music\u00d7IT\u00d7guiter\u00d7programing","inLanguage":"ja","publisher":{"@id":"https:\/\/ito-u-oti.com\/#person"}}]},"og:locale":"ja_JP","og:site_name":"\u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","og:type":"article","og:title":"\u3010SpringBoot\u3011Interceptor\u3067Header\u60c5\u5831\u3092\u53d7\u3051\u53d6\u308a\u3001Service\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","og:description":"Header\u60c5\u5831\u3092Controller\u306eIF\u90e8\u5206\u3067\u53d7\u3051\u53d6\u308c\u3070\u3001\u666e\u901a\u306b\u5f8c\u7d9a\u306eService\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c","og:url":"https:\/\/ito-u-oti.com\/?p=1194","og:image":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2020\/06\/spring-boot-logo.jpg","og:image:secure_url":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2020\/06\/spring-boot-logo.jpg","og:image:width":300,"og:image:height":300,"article:published_time":"2020-06-25T01:59:54+00:00","article:modified_time":"2020-06-25T02:00:07+00:00","twitter:card":"summary","twitter:title":"\u3010SpringBoot\u3011Interceptor\u3067Header\u60c5\u5831\u3092\u53d7\u3051\u53d6\u308a\u3001Service\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b | \u30f0\u5200\u306e\u304a\u3082\u3061\u3083\u7bb1","twitter:description":"Header\u60c5\u5831\u3092Controller\u306eIF\u90e8\u5206\u3067\u53d7\u3051\u53d6\u308c\u3070\u3001\u666e\u901a\u306b\u5f8c\u7d9a\u306eService\u5c64\u306a\u3069\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c","twitter:creator":"@itouoti_IoT","twitter:image":"https:\/\/ito-u-oti.com\/wp-content\/uploads\/2020\/06\/spring-boot-logo.jpg"},"aioseo_meta_data":{"post_id":"1194","title":null,"description":null,"keywords":[{"label":"Spring boot","value":"Spring boot"},{"label":"Interceptor","value":"Interceptor"}],"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":"","og_description":"","og_object_type":"article","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":"","og_article_tags":"","twitter_use_og":false,"twitter_card":"summary","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[],"defaultGraph":"","defaultPostTypeGraph":""},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-04-11 14:07:34","updated":"2025-06-04 06:05:57","seo_analyzer_scan_date":null},"_links":{"self":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/1194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1194"}],"version-history":[{"count":2,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/1194\/revisions"}],"predecessor-version":[{"id":1198,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/1194\/revisions\/1198"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/media\/1197"}],"wp:attachment":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}