Skip to content

Commit f531149

Browse files
committed
Use mvc:resources for serving static content (i.e. CSS files).
@see http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-static-resources Fixed #104 No functional changes.
1 parent 46c74da commit f531149

File tree

5 files changed

+5
-3
lines changed

5 files changed

+5
-3
lines changed

src/main/resources/spring/DispatcherServletContext.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
<mvc:annotation-driven />
2828

29+
<mvc:resources mapping="/static/**" location="/WEB-INF/static/*" />
30+
2931
<!-- see also src/ru/mystamps/web/SiteMap.java -->
3032
<mvc:view-controller path="/site/index.htm" view-name="site/index" />
3133
<mvc:view-controller path="/site/maintenance.htm" view-name="site/maintenance" />

src/main/webapp/WEB-INF/segments/std.jspf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
<spring:url var="restorePasswordUrl" value="/password/restore.htm" />
88
<spring:url var="addStampsUrl" value="/stamps/add.htm" />
99
<spring:url var="addCountryUrl" value="/country/add.htm" />
10-
<spring:url var="mainCssUrl" value="/styles/main.css" />
11-
<spring:url var="errorCssUrl" value="/styles/error.css" />
10+
<spring:url var="mainCssUrl" value="/static/styles/main.css" />
11+
<spring:url var="errorCssUrl" value="/static/styles/error.css" />

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

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

2222
<servlet-mapping>
2323
<servlet-name>spring</servlet-name>
24-
<url-pattern>*.htm</url-pattern>
24+
<url-pattern>/</url-pattern>
2525
</servlet-mapping>
2626

2727
<!-- see http://javatalks.ru/sutra67480.php#67480 -->

0 commit comments

Comments
 (0)