spring-java-config相关内容
我正在尝试使用基于Javaconfig的Spring配置.我有两个相同类型的bean,并尝试通过Qualifier自动装配它们.但这似乎不起作用. 这是我的配置类 @Configuration @EnableAutoConfiguration @ComponentScan("com.test") public class BasicConfig {
..
我有两个班级:Vehicle.Tire和vehicle.Car. package vehicle; @Named public class Tire { private String age; } package vehicle; @Named public class Car { private Tire tire; // Spring calls this s
..
我的春季java-config应用程序打包为war在weblogic 12.1.3上运行时没有问题,因此我尝试将相同war部署到weblogic 12.2.1中,这会导致java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/DispatcherServlet-servlet.xml]. 似乎即
..
使用纯Spring Java Config,我很难让Spring和CAS执行单一注销.我可以使用单点登录进行以下配置.我使用一个简单的JSP页面将表单POST到url https://nginx.shane.com/app/logout,然后将CSRF值包含在POST的数据中.一切似乎都正常,但当我进入安全页面时,它无需登录即可直接进入.有任何想法吗? @Configuration @Ena
..
我在项目中使用spring-boot,并运行由spring-boot构建的jar文件,将其作为Centos上的服务.当我运行此服务时: 服务myApp启动 我总是收到以下错误消息: 2016-08-26 09:11:02.002 ERROR 31900 --- [ main] o.s.b.c.FileEncodingApplicationListener :
..
我需要使用url中的令牌ID(或可能是请求标头中的令牌ID)对一些其他服务进行身份验证,但这暂时不重要.我正在尝试使用Java配置来设置此设置,并以此 post 作为指导.我的问题是我不知道如何处理从提供者身份验证失败时引发的"BadCredentialsException".这是我的安全配置: public static class SecurityConfigForRS extends
..
我使用java配置来配置Spring Security,并且自定义了AuthenticationProvider和UserDetailsService,以在下面添加额外的登录字段 http://forum.spring.io/forum/spring-projects/security/95715-extra-login-fields 我很难通过使用java配置将两个定制的类添加到Spr
..
当前,我正在将xml转换为java config.但是我坚持研究了几天.问题出在这里: Xml配置:
..
有人可以建议为什么我们需要使用 static 方法声明PropertySourcesPlaceholderConfigurer bean吗?我只是发现,如果我在下面使用非静态方法,那么url将被设置为null值,而不是从属性文件中提取- @Value("${spring.datasource.url}") private String url; @Bean public static Pr
..
我的初始值班课程 public class HomeServlet extends AbstractAnnotationConfigDispatcherServletInitializer{ @Override protected Class[] getRootConfigClasses() { return null; } @Override protected Cl
..
我仅使用JavaConfig. 我有以下声明: @Bean public static PropertySourcesPlaceholderConfigurer propertyPlaceholderConfigurer() { return new PropertySourcesPlaceholderConfigurer(); } 根据以下文章,它对于JavaConfig
..
我有以下要根据属性实例化的以下组件类; @Component("componentA") @PropertySource("classpath:components.properties") @ConditionalOnExpression("'${components.enabled}'.contains('componentA')") public class ComponentA im
..
在以前的OAuth2版本中,可以通过将自定义令牌授予者添加到元素中的xml配置中来添加它. 我想知道如何使用AuthorizationServerConfigurerAdapter使用Java Config扩展授权服务器,而又不丢失默认配置,该默认配置包含隐式,客户端凭据,刷新令牌和授权代码授予类型. 首次尝试使用通过@Component创建
..
使用基于Spring Batch xml的配置,您可以像下面这样参数化commit-interval/chunk大小:
..
我想使用Java Config在Spring Boot中定义类似于此XML的内容. 我需要一种不同的方法来保护它们,并且不能进行表单登录.确保它们安全将在以后出现.现在,我想停止使用http.formLogin()保护它们. 我已经这样重写了WebSecurityConfigure
..
我正在尝试配置Spring Boot应用程序以使用Apache Shiro作为其安全框架.我可以使用PropertiesRealm进行所有操作,现在我正在尝试使其与JdbcRealm和Spring Boot的内置H2数据库一起使用.这是我pom.xml中的依赖项: org.apache.shiro
..
我正在尝试使用JavaConfig代替Spring Security的XML配置. 我想使用@PreAuthorization声明访问权限. 我的Spring Security Config看起来像这样: @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity( prePostEnabled = true ) publ
..
我有一个Spring @Configuration类,当在环境中设置了特定的属性值时,该类应该注册一个bean.我编写了一个自定义的Condition实现,用于检查该值是否存在,并且在Spring Boot中启动该应用程序时可以运行,但是在运行JUnit测试时从未注册该bean.我调试了该应用程序,并确定在实例化PropertySourcesPlaceholderConfigurer之前正在评估C
..
我有一个同时侦听HTTP和HTTPS的Spring Security版本3.2.3应用程序.我希望对HTTP端口的任何请求都重定向到HTTPS.我该如何仅使用Java进行配置? public class WebSecurityConfig extends WebSecurityConfigurerAdapter { protected void configure(HttpSecurity
..
是否可以使用org.springframework.security.config.annotation.web.builders.HttpSecurity将发帖请求授权给特定的url? 我正在使用HttpSecurity as: @Override protected void configure(HttpSecurity http) throws Exception
..