Skip to content

Commit d0fcabf

Browse files
committed
Moved (and renamed) Spring MVC config from WEB-INF to classpath.
WEB-INF/spring-servlet.xml -> WEB-INF/classes/spring/DispatcherServletContext.xml No functional changes.
1 parent 1f32e20 commit d0fcabf

File tree

13 files changed

+13
-9
lines changed

13 files changed

+13
-9
lines changed

pom.xml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@
417417
</goals>
418418
<configuration>
419419
<outputDirectory>
420-
${project.build.directory}/${build.finalName}
420+
${project.build.outputDirectory}
421421
</outputDirectory>
422422
<resources>
423423
<resource>
@@ -463,7 +463,7 @@
463463
</goals>
464464
<configuration>
465465
<outputDirectory>
466-
${project.build.directory}/${build.finalName}
466+
${project.build.outputDirectory}
467467
</outputDirectory>
468468
<resources>
469469
<resource>
@@ -483,17 +483,15 @@
483483
<component>
484484
<name>hbm2ddl</name>
485485
<implementation>jpaconfiguration</implementation>
486-
<outputDirectory>
487-
target/${build.finalName}/WEB-INF/classes
488-
</outputDirectory>
486+
<outputDirectory>target/classes</outputDirectory>
489487
</component>
490488
</components>
491489
<componentProperties>
492490
<console>false</console>
493491
<format>true</format>
494492
<jdk5>true</jdk5>
495493
<propertyfile>
496-
${env.dir}/test/WEB-INF/database.properties
494+
${env.dir}/test/spring/database.properties
497495
</propertyfile>
498496
<outputfilename>hsql-scheme.sql</outputfilename>
499497

src/main/java/ru/mystamps/web/SiteMap.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public final class SiteMap {
1313
// defined at pom.xml (and used by functional tests only)
1414
public static final String SITE_URL = "http://127.0.0.1:8081";
1515

16-
// defined at webapp/WEB-INF/spring-servlet.xml
16+
// defined at src/main/resources/spring/DispatcherServletContext.xml
1717
public static final String INDEX_PAGE_URL = "/site/index.htm";
1818
public static final String MAINTENANCE_PAGE_URL = "/site/maintenance.htm";
1919

@@ -26,7 +26,7 @@ public final class SiteMap {
2626

2727
public static final String ADD_COUNTRY_PAGE_URL = "/country/add.htm";
2828

29-
// defined at webapp/WEB-INF/spring-servlet.xml
29+
// defined at src/main/resources/spring/DispatcherServletContext.xml
3030
public static final String RESTORE_PASSWORD_PAGE_URL = "/password/restore.htm";
3131

3232
public static final String NOT_FOUND_PAGE_URL = "/error/404.htm";

src/main/webapp/WEB-INF/database.xml renamed to src/main/resources/spring/database.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<tx:annotation-driven />
1313

14-
<context:property-placeholder location="/WEB-INF/database.properties" />
14+
<context:property-placeholder location="classpath:spring/database.properties" />
1515

1616
<import resource="datasource.xml" />
1717

src/main/webapp/WEB-INF/web.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
<servlet-class>
1111
org.springframework.web.servlet.DispatcherServlet
1212
</servlet-class>
13+
<init-param>
14+
<param-name>contextConfigLocation</param-name>
15+
<param-value>
16+
classpath:spring/DispatcherServletContext.xml
17+
</param-value>
18+
</init-param>
1319
<load-on-startup>1</load-on-startup>
1420
</servlet>
1521

0 commit comments

Comments
 (0)