Check the Spring configuration defined by the contextConfigLocation context-param element

This rule checks for the use of Spring files that the other rules did not flag.

Spring allows for the configuration of the location of its configuration files using a web.xml property called contextConfigLocation . The files defined by this property can be within the same web project or may be in JAR file. If the files are available within the project, the Spring configuration rules should find them and flag any issues in those files. However, if your configuration files are in a JAR file and not readily available, those files will not be analyzed.

This rule flags the property named contextConfigLocation within the web.xml file if it cannot find the corresponding configuration files within the same dynamic web project. If a file match is not found, the contextConfigLocation element is flagged to warn you that some of your Spring configuration was not evaluated.

Consider the following XML code snippet:

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>META-INF/jndi_DataSource.xml, classpath:*_JNDI.xml</param-value>
<context-param>

The value classpath:*_JNDI.xml in param-value will be evaluated. If no file in the project matches the name pattern *_JNDI.XML, the element will be flagged in web.xml. The recommended action is to locate the matching Spring configuration files and determine if any Spring migration is needed. It is possible that the configuration files are in a JAR file.