Holooly Plus Logo

Input / Question:

Input / Question:

How do add a bean in spring application?

Verified

Output/Answer

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>

<bean id="foo" class="com.act.Foo"/>

<bean id="bar" class="com.act.Bar"/>

</beans>

In the bean tag the id attribute specifies the bean name and the class attribute specifies the fully qualified class name.