Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add bean configuration file in an eclipse-based Spring project?

I started to work on a Spring project from scratch and while I was trying to add a new Spring bean configuration file, I just don't see it there. The project structure and the selection wizard is as following,

enter image description here

Figure: No Spring section here in the selection wizard

enter image description here Figure: project structure

How to add a bean configuration file in the project ? I tried to get a template and add in the project. However, I don't see the different tabs (such as, mvc, context etc ) in the file page. The maven dependencies are fine and it's dynamic web project. I also tried with maven-archetype-webapp as starting point of the project.

like image 667
Arefe Avatar asked Apr 02 '16 06:04

Arefe


People also ask

Where is Spring bean configuration file?

You will need to add spring. xml file at the location - src/main/resources folder. You can have your directory structure inside this directory as - src/main/resources/com/vipin/dao. src/main/java directory is preferred for java classes.

How can we load all the bean configuration files?

You may load multiple Spring bean configuration files in the code : ApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"Spring-Common. xml", "Spring-Connection. xml","Spring-ModuleA.


1 Answers

  1. Help > Eclipse market
  2. Type spring and search
  3. Find Spring IDE Roo Support and click install
  4. Accept terms and click finish
  5. Restart Eclipse
  6. File > New > Others > Spring > Spring Bean configuration file
like image 72
Vugar Asadov Avatar answered Sep 23 '22 01:09

Vugar Asadov