草庐IT

configurer

全部标签

spring - 正确的 mvc :interceptor configuration in Spring

我有点问题。我需要在这个拦截器中调用每个请求的postHandle方法:publicclassDiMenuInterceptorextendsHandlerInterceptorAdapter{@AutowiredprivateIDiCategoryServicecategoryService;@OverridepublicvoidpostHandle(HttpServletRequestrequest,HttpServletResponseresponse,Objecthandler,ModelAndViewmodelAndView)throwsException{modelAndV

spring - Kotlin 无法在使用 @Configuration @EnableWebMvc 注释的类中创建 @Autowired 字段

Autowired字段在初始化项目时为null:packagecom.lynas.configimportorg.springframework.stereotype.Componentimportorg.springframework.web.servlet.handler.HandlerInterceptorAdapterimportjavax.servlet.http.HttpServletRequestimportjavax.servlet.http.HttpServletResponse@ComponentopenclassInterceptorConfig:HandlerI

java - Spring 3中@Component和@Configuration的区别

我遇到了Spring3提供的两个注释(@Component和@Configuration)我对这些有点困惑。这是我读到的关于@Component的内容Putthis“context:component”inthebeanconfigurationfile,itmeans,enabletheauto-scanningfeatureinSpring.Thebase-packageisindicatewhereareyourcomponentsstored,Springwillscanthisfolderandfindoutthebean(annotatedwith@Component)an

java - Spring 3中@Component和@Configuration的区别

我遇到了Spring3提供的两个注释(@Component和@Configuration)我对这些有点困惑。这是我读到的关于@Component的内容Putthis“context:component”inthebeanconfigurationfile,itmeans,enabletheauto-scanningfeatureinSpring.Thebase-packageisindicatewhereareyourcomponentsstored,Springwillscanthisfolderandfindoutthebean(annotatedwith@Component)an

java - Spring @Configuration 和 <context :component-scan/>

我有一个场景configuringSpringSecurityonembeddedJetty如果我使用JavaConfig来配置Jetty服务器,这似乎有点解决了。因此,对于大型项目来说,JavaConfig而不是XML可能是更好的选择。但是,XML命名空间中有一些细节,例如@Configuration中不容易获得的设置。我发现ApplicationContextAware荣获@Configuration类,所以以下是可能的@ConfigurationpublicclassFooConfigimplementsApplicationContextAware{@Overridepubli

java - Spring @Configuration 和 <context :component-scan/>

我有一个场景configuringSpringSecurityonembeddedJetty如果我使用JavaConfig来配置Jetty服务器,这似乎有点解决了。因此,对于大型项目来说,JavaConfig而不是XML可能是更好的选择。但是,XML命名空间中有一些细节,例如@Configuration中不容易获得的设置。我发现ApplicationContextAware荣获@Configuration类,所以以下是可能的@ConfigurationpublicclassFooConfigimplementsApplicationContextAware{@Overridepubli

java - 如何在 @Configuration/@Bean 使用的单元测试中禁用 Spring Autowiring

我想使用spring-test配置内部类(@Configuration)配置组件测试。测试的组件有一些我想为测试模拟的服务。这些服务是类(不使用接口(interface))并在其中具有Spring注释(@Autowired)。Mockito可以轻松地模拟它们,但是,我发现无法禁用SpringAutowiring。我如何轻松复制的示例:@RunWith(SpringJUnit4ClassRunner.class)@ContextConfiguration(classes=SomeTest.Beans.class)publicclassSomeTest{//configuredincomp

java - 如何在 @Configuration/@Bean 使用的单元测试中禁用 Spring Autowiring

我想使用spring-test配置内部类(@Configuration)配置组件测试。测试的组件有一些我想为测试模拟的服务。这些服务是类(不使用接口(interface))并在其中具有Spring注释(@Autowired)。Mockito可以轻松地模拟它们,但是,我发现无法禁用SpringAutowiring。我如何轻松复制的示例:@RunWith(SpringJUnit4ClassRunner.class)@ContextConfiguration(classes=SomeTest.Beans.class)publicclassSomeTest{//configuredincomp

ruby-on-rails - #<Rails::Application::Configuration:0x1cf3338> 在登台时未定义方法 `sass'

我正在尝试在服务器上部署我的应用程序并使用暂存环境。但它在暂存环境中一直给我这个错误。undefinedmethod`sass'for#Rails::Application::Configuration:0x1cf3338在我的本地开发环境中,它运行良好。在我的应用程序中,我使用了指南针和susy框架,我的Gemfile看起来像这样https://gist.github.com/2003755我在过去2天尝试对其进行配置,但仍未找到使其工作的方法。以前此配置工作正常。在我最后一次部署之后,突然间一切都崩溃了。谢谢 最佳答案 如果您从

ruby-on-rails - rails : configuring a form action's host using custom URL from settings

我有一个Rails应用程序,我在生产环境中跨域提供该应用程序。它需要绝对引用。因此,我在config/environments/production.rb中启用了以下内容:config.action_controller.asset_host="http://myapp.herokuapp.com"这适用于图像和资源,但我的输入表单看起来像这样:'post',:remote=>true)do%>仍在控制台中得到这个:Failedtoloadresourcefile://localhost/plans/collapse_plan如何更改它以便表单操作自动包含指定的主机,而不是默认为本地主