Questions tagged [spring-annotations]

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

The Spring Framework () provides several annotation-driven configuration options from wiring beans to managing transaction.

Annotation types

JSR support

  • JSR 107
    • @CacheResult
    • @CachePut
    • @CacheRemove
    • @CacheRemoveAll
    • @CacheDefaults
    • @CacheKey
    • @CacheValue
  • JSR 250:
    • @Resource
  • JSR 303:
    • @Valid
    • @NotNull
    • @Size, etc
  • JSR 330:
    • @Inject
    • @Named

Useful links

1301 questions
-1
votes
1 answer

Spring annotations are not working in IBM mobile First V 7.1.0

I tried to use inbuilt Spring Annotations in adapters. Basically I tried @Autowired. I guess the bean is not getting registered.Are there any configurations involved?
Prisy
  • 90
  • 11
-1
votes
2 answers

How can I put an instance of an object as session attribute in a Spring MVC project?

I am working on a Spring MVC application and I have the following problem. I have this RegistrazioneInfo class that contains some information inserted into a form by the user: public class RegistrazioneInfo { @NotNull @Size(min=16, max=16) …
AndreaNobili
  • 40,955
  • 107
  • 324
  • 596
-1
votes
2 answers

Nested autowiring in JUnit test not working

I'm developing a spring application using JavaFX (I'm NOT using Spring MVC) and I have standard separation of concerns with controllers - services - DAOs. I'm using JdbcTemplate. I'm willing to write down jUnit tests for one of my services (I have…
Ivaylo Toskov
  • 3,911
  • 3
  • 32
  • 48
-2
votes
3 answers

Difference between @ConditionalOnClass , @ConditionalOnMissingClass

Difference between @ConditionalOnClass, @ConditionalOnMissingClass? Can someone give me the difference between these annotations?
-2
votes
1 answer

How to understand the spring reference documentation regarding @Autowired

Hopefully this question is simple enough. I'm reading the Spring Framework Reference:beans-java section and I came across this usage example The part that confuses me is the note at the end, specifically where it says Note also that there is no…
mdo123
  • 1,757
  • 3
  • 16
  • 34
-2
votes
1 answer

Looking for @ControllerAdvice

I am using Spring Tool Suite. Now console shows below partly. In SampleController.java next to console log, RequestMapping about doA, doB was not mapped. How can I fix that? console log INFO :…
yonsok
  • 53
  • 1
  • 8
-2
votes
2 answers

Spring @RequestMapping 404

I'm pretty new to Spring, and encountering a problem with RequestMapping. I want to learn using annotations, so i tried creating a small project which works with those. Anyway, i keep getting 404, but as far as i understand i did everything right.…
Heady
  • 935
  • 3
  • 10
  • 23
-2
votes
1 answer

Why I can't inject (using @Autowired) a service class into the Main class (the class that contains the main() method) in this Spring application?

I am pretty new in Spring and I have the following problem. I am implement a Spring console application (this is not a web app) that perform some query on the database and I have the following configuration: A beans.xml file containing the beans…
AndreaNobili
  • 40,955
  • 107
  • 324
  • 596
-2
votes
1 answer

Spring DI based on annotations

i try to use spring, and stuck with spring configuration. As you see in title i try to configure on annotations and also try to use spring-boot (which is very good as i think). So my question is very simple (i think), is how to inject my bean to…
viq
  • 317
  • 1
  • 3
  • 17
-4
votes
1 answer

What is use of Annotations in spring?

I'm a beginner to spring. All i see in using spring is configuring dependencies in xml format and enhance the maintainability by not changing the class files .but when we use annotations and auto wiring we are again recompiling class files which…
-4
votes
1 answer

@Aspect cannot be resolved to a type in spring aop. iam using jdk 1.7

code and error you can find the code and error in the first image. and libraries in the second image.libraries
1 2 3
86
87