Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

improve handling of static resources

moved resources under the same folder
simplified web.xml by using Spring 3.x portable mvc:resources
  • Loading branch information...
commit dc20f330030bd9738928030996db7a678de77eb4 1 parent 4abae01
Costin Leau authored
View
7 retwisj/src/main/webapp/WEB-INF/retwisj-servlet.xml
@@ -7,11 +7,12 @@
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
- <!--
- - The controllers are autodetected POJOs labeled with the @Controller annotation.
- -->
+ <!-- The controllers are autodetected POJOs labeled with the @Controller annotation. -->
<context:component-scan base-package="org.springframework.data.redis.samples.retwisj"/>
+ <!-- Portable static resource handler -->
+ <mvc:resources mapping="/static/**" location="/static/" cache-period="31556926"/>
+
<mvc:annotation-driven/>
<mvc:interceptors>
View
31 retwisj/src/main/webapp/WEB-INF/web.xml
@@ -47,37 +47,6 @@
</listener>
<!--
- Defines the 'default' servlet (usually for service static resources).
- Uncomment this in containers (GlassFish) that do not declare this
- implicit definition out of the box, or change the name of the servlet mapping
- below to the appropriate one.
-
- <servlet>
- <servlet-name>default</servlet-name>
- <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
- <init-param>
- <param-name>debug</param-name>
- <param-value>0</param-value>
- </init-param>
- <init-param>
- <param-name>listings</param-name>
- <param-value>false</param-value>
- </init-param>
- <load-on-startup>1</load-on-startup>
- </servlet>
- -->
- <!--
- - Map static resources to the default servlet
- - examples:
- - http://localhost:8080/static/images/retwis.png
- - http://localhost:8080/static/styles/retwis.css
- -->
- <servlet-mapping>
- <servlet-name>default</servlet-name>
- <url-pattern>/static/*</url-pattern>
- </servlet-mapping>
-
- <!--
- Servlet that dispatches request to registered handlers (Controller implementations).
- Has its own application context, by default defined in "{servlet-name}-servlet.xml",
- i.e. "retwis-servlet.xml".
View
0  retwisj/src/main/webapp/images/springsource-logo.png → ...c/main/webapp/static/images/springsource-logo.png
File renamed without changes
View
0  retwisj/src/main/webapp/styles/custom.css → retwisj/src/main/webapp/static/styles/custom.css
File renamed without changes
View
0  retwisj/src/main/webapp/styles/ie.css → retwisj/src/main/webapp/static/styles/ie.css
File renamed without changes
View
0  retwisj/src/main/webapp/styles/print.css → retwisj/src/main/webapp/static/styles/print.css
File renamed without changes
View
0  retwisj/src/main/webapp/styles/screen.css → retwisj/src/main/webapp/static/styles/screen.css
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.