Top "Autowired" questions

Autowiring is a DI container feature where the dependencies are automatically looked for according to some criteria.

How to overwrite Spring service beans by name, using annotations only

Given I have a Spring bean configured as @Service("myService") public class DefaultService extends MyService { } and a class using this …

spring javabeans overwrite autowired inject
Spring Autowiring class vs. interface?

I have this Spring config: <bean id="boo" class="com.x.TheClass"/> The class TheClass implements TheInterface. Then …

java spring dependency-injection autowired
Could not autowire. No beans of SimpMessagingTemplate type found

I am configuring Websockets in Spring basically by following the guide provided in the documentation. I am currently trying to …

java javabeans autowired stomp spring-messaging
Inject and Resource and Autowired annotations

What's the difference between @Inject and @Resource and @Autowired annotations? When should we use each of them?

spring dependency-injection annotations cdi autowired
How to autowire by name in Spring with annotations?

I have several beans of the same class defined: @Bean public FieldDescriptor fullSpotField() { FieldDescriptor ans = new FieldDescriptor("full_spot", String.…

java spring autowired
Autowiring in servlet

i want to use spring autowiring in servlet so here's my code: @Configurable public class ImageServlet extends HttpServlet { @Autowired private …

spring jakarta-ee servlets dependency-injection autowired
How to autowire an object in spring in an object created with new

all I want to do is autowire the field backgroundGray in the NotesPanel class, but all I get is the …

java spring autowired
Where is the @Autowired annotation supposed to go - on the property or the method?

Which is more correct? This (with the @Autowired annotation on the method)? @Controller public class MyController { private MyDao myDao; @Autowired …

spring dependency-injection spring-mvc annotations autowired
@Autowired vs @Required on setter

I'm curious to know what's the difference between code like this: class MyClass { @Autowired MyService myService; } and code like this: …

java spring resources autowired required
spring 3 autowiring and junit testing

My code: @Component public class A { @Autowired private B b; public void method() {} } public interface X {...} @Component public class B …

spring junit autowired