Organizing Spring Configuration Files

See Also

The IDE provides support for organizing Spring configuration files. This support allows you to specify all your configuration files and organize them into groups, so that they can refer to each other in features such as code completion and hyperlinking. The Spring Configuration Group panel, located in the Project Properties window, enables you to organize Spring configuration files.

To access the Spring Configuration Group panel:

  1. Make sure the Spring support has been enabled, for example by adding the Spring Framework library to the project.
  2. Right-click on the project node in the Projects window and choose Properties.
  3. Under Categories, select Spring Framework.

The Spring Framework category contains two tabs: Configuration Files and Configuration File Groups. The Configuration Files tab lists all the Spring configuration files in a project, and the Configuration File Groups lists all configuration file groups.

Specifying Spring configuration files

Select the Configuration Files tag. You can use the Add File and Remove File buttons to add and remove files from the list, or you can use the Detect Files button to let the Spring support try to autodetect the configuration files.

Organizing the Spring configuration files into groups

Groups are useful for setting up parent/child relationships between configuration files. For example, in a web application is is typical to have a applicationContext.xml file containing business logic service beans, and a spring-servlet.xml file containing Spring Web MVC beans such as controllers. The beans in spring-servlet.xml are often initialized with service beans from applicationContext.xml, and this fact needs to be reflected in features such as code completion and hyperlinking. In order to set up such a relationship, you would create a group containing these two files.

Select the Configuration File Groups tab. You can use the Add Group, and Remove Group button to add and remove groups. After adding a group, you can add/remove files to/from it using the Add Files and Remove Files buttons.

See Also
About Spring Framework Support
Adding Spring Support to a Project
Creating a Spring Configuration File

Legal Notices