Annotation wiring in Spring

0 votes

Can someone please explain, how I can turn on the annotation wiring in Spring Framework?

Jul 3, 2018 in Java by anto.trigg4
• 3,420 points
106 views

1 answer to this question.

0 votes

By default, Annotation wiring is not turned on in the Spring container. Thus, to use annotation based wiring we must enable it in our Spring configuration file by configuring <context:annotation-config/> element. For example:

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context">
<context:annotation-config/>
<beans ………… />
</beans>​
answered Jul 3, 2018 by code.reaper12
• 3,450 points

Related Questions In Java

0 votes
2 answers

What is the use of @Override annotation in Java ? When do we use it ?

@Override annotation is used when we override ...READ MORE

answered Aug 14 in Java by Sirajul
• 37,480 points
112 views
0 votes
1 answer

Autowired field pointing NULL in Spring

The field annotated @Autowired is null because ...READ MORE

answered Jun 6, 2018 in Java by avi
• 160 points
5,523 views
0 votes
1 answer

Bean Scopes in Java Spring

According to my knowledge, the Spring Framework ...READ MORE

answered Jul 3, 2018 in Java by geek.erkami
• 2,640 points
97 views
0 votes
1 answer

Configuration metadata in Spring Framework

Configuration metadata can be provided to Spring container in ...READ MORE

answered Aug 2, 2018 in Java by code.reaper12
• 3,450 points
1,345 views
0 votes
1 answer

@Autowired annotation in Spring Framework

The @Autowired annotation provides more accurate control over where ...READ MORE

answered Aug 2, 2018 in Java by geek.erkami
• 2,640 points
143 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

@Component vs @Repository vs @Service in Spring Framework

As you might be knowing, all these ...READ MORE

answered May 29, 2018 in Java by geek.erkami
• 2,640 points
849 views
0 votes
1 answer
0 votes
1 answer

@RequestMapping annotation in Java Spring

The @RequestMapping annotation in Spring Framework is ...READ MORE

answered Sep 11, 2018 in Java by code.reaper12
• 3,450 points
250 views