FAQ Database Discussion Community


Adding Bcrypt Encoding to Spring MVC Security with limit login attempts

java,spring,spring-mvc,spring-security,spring-bean
I have a working project with limit login attempts i just need to add Bcrypt password encryptation. I have the following beans: <beans:bean id="customUserDetailsService" class="com.setelog.spring.service.CustomUserDetailsService"> <beans:property name="usersByUsernameQuery" value="select * from users where username = ?"/> <beans:property name="authoritiesByUsernameQuery" value="select username, role from user_roles where username =?" /> <beans:property name="dataSource" ref="dataSource" />...

Spring passsing autowired object to class constructor

java,spring,spring-mvc,autowired,spring-bean
I got problem with my SpringMVC application I have class annotated with @Component with 2 fields annotated with @Autowired @Component public class Crud { private final Logger logger = LoggerFactory.getLogger(Crud.class); private final Map<String, Database> dataSources = new HashMap<>(); @Autowired private DataSource clientDataSource; @Autowired private DataSource adminDataSource; public Crud(){ dataSources.put("client", new...

How to create Spring Security 3.1 Datasource bean in a java class

java,spring,spring-security,spring-bean
I am new to JSF and Spring Security. I am building a JSF 2 project based on this tutorial. I want to put the dataSource bean in a java class because I am generating the url for the JDBC connection and users in another class. How to put this code...

Spring OAuth2 implementation with InMemoryTokenStore bean creation issue

maven,spring-mvc,spring-security,oauth-2.0,spring-bean
I try to implement Oauth2 into my project using this blog I am newbie on Spring framework, so occured an exception such as ClassNotFoundException, altough all comliant classes exist under right package though. Source (maven project) can be seen on github Thank you Error begins with: org.springframework.beans.factory.BeanCreationException: Error creating bean...

Equivalent of org.springframework.boot.context.embedded.FilterRegistrationBean for non-Boot Spring project?

spring,spring-mvc,servlet-filters,spring-bean,spring-session
I'm trying to implement external session handling in Spring, as per this tutorial. I'm having some trouble adding the right filter though. Spring Boot appears to have defined the proper bean/filter, but my project is not Spring Boot, so it cannot find the FilterRegistrationBean. Is there some sort of equivalent...

How to get all self injected Beans of a special type?

spring,spring-boot,spring-bean
I would like to build a Spring application, where new components can be added easily and without much configuration. For example: You have different kinds of documents. These documents should be able to get exported into different fileformats. To make this functionality easy to maintain, it should (basically) work the...

cleanest way to create multiple beans of the same class with different properties

java,spring,dependency-injection,spring-bean,spring-properties
Say I have this properties file: students.bill.firstname=John students.bill.lastname=Doe students.bill.age=20 students.jim.firstname=Jim students.jim.lastname=Wright students.jim.age=21 . . . I want an xml bean that contains a map of students that has their firstname as the key. Object example: Student.java public class Student { String firstname; String lastname; Integer age; } Classroom.java public class...

Spring XML - ignore $ in url which is writen in xml , without using propeties file

spring,spring-bean
I have a spring bean which contain list of strings. Every string represent a url which in runtime is resolved using ognal For example: www.google.co.il/?name%3d${name}&amp;lastname%3d${lastname} Which is resolved in run time . How can I ignore spring from looking for this ${} in environment? For now it takes the properties...