spring(spring.xml.jet) - Add bean to spring

Introduce

Add bean to spring.

Related knowledge:

Task

Tag


Task And Model

The model group of the current task is shop, 
which contain a Java entity model book, 
and the relation value of book is one;

More about the model structure of this demo, please click: Demo model structure 

There are 2 ways to select the model:

Note: this is a merge task.

Before merger

In merged file the annotation symbols which id is equal to bean, is the insert position.

We use the insert tag to insert the merged content at the same id position, you only need to write the merged content in the template.

Class and class can be used to splice class name, insert BookDaoImpl and BookServiceImpl beans to spring config file.

Result, these 2 bean are inserted into the spring config file.

Tip, you can get the merge symbol in the xml file by code prompt.