Top "Spring-annotations" questions

A common placeholder for issues related to the use of annotations with the Spring framework

Spring autowired bean causes null pointer

I have a logger class that makes use of a service. Each time a new logger is created, I expect …

java spring junit autowired spring-annotations
How to configure component-scan by annotation only in Spring?

I'm running a war file on a tomcat webserver environment. I have an annotation based config for @Beans, and a …

java spring spring-annotations
@Transient annotation, @org.springframework.data.annotation.Transient annotation, transient keyword and password storing

Currently I'm learning the Spring framework, mainly focusing on it's Security Module. I've watched some guides in connection with registration …

jpa spring-security spring-data spring-annotations transient
Multiple DataSource and JdbcTemplate in Spring Boot (> 1.1.0)

I would like to inject a specific JdbcTemplatein a Spring Boot project. I tried to follow this example for multiple …

java spring spring-boot jdbctemplate spring-annotations
why do we have to use @Modifying annotation for queries in Data Jpa

for example I have a method in my CRUD interface which deletes a user from the database: public interface CrudUserRepository …

java spring spring-data-jpa spring-annotations
Inject parameters to constructor through annotation in Spring

I am using Spring Boot annotation configuration. I have a class whose constructor accepts 2 parameters (string, another class). Fruit.java …

spring-boot spring-annotations
Spring 3 MVC - form:errors not showing the errors

I am using annotation based validation but for one of the forms I am not able to show any errors …

spring-mvc spring-annotations
applicationContext not finding Controllers for Servlet context

I have a Spring web app with an applicationContext.xml and a dispatcher-servlet.xml configuration. I've defined the <context:…

spring spring-mvc spring-annotations
How to check request parameter is not empty String in @RequestMapping params?

In my controller I have String parameter, containing some id, that should not be null of empty string. I'm wondering, …

java spring spring-mvc hibernate-validator spring-annotations
Difference between Spring annotations

Questions: 1) Difference between @Component and @Configuration? I have read that both remove the necessity of wiring code to be put …

java spring spring-annotations