I am studyng Spring MVC and I have find this simple Hello World tutorial: http://www.tutorialspoint.com/spring/spring_hello_world_example.htm
In this tutorial the author creat a Bean Configuration file named Beans.xml, something like this:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="helloWorld" class="com.tutorialspoint.HelloWorld">
<property name="message" value="Hello World!"/>
</bean>
</beans>
Using tis file the Spring Framework can create all the beans defined and assign them a unique ID as defined in tag. And I can use tag to pass the values of different variables used at the time of object creation.
Is this the well know Bean Factory?
My doubt is related to the following thing: in my previous example I don't use a Bean Configuration file to define my bean, but I use the annotation to define what is a Spring bean and how this bean work (for example I use @Controller annotation to say Spring that a class act as a Controller Bean)
Use the bean configuration file and use the annotation have the same meaning?
Can I use both?
For example, if I have to configure JDBC can I configure it inside beans.xml file and at the same time can I use annotaions for my Controller class?
Tnx