日期:2014-05-20 浏览次数:20754 次
<servlet> <servlet-name>resource-servlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:resource-web-context.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>resource-servlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping>
<mvc:resources location="/resources/" mapping="/resources/**" cache-period="3600"/> <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"> <property name="ignoreAcceptHeader" value="true" /> <property name="defaultContentType" value="text/html" /> <property name="mediaTypes"> <map> <entry key="xls" value="application/vnd.ms-excel" /> <entry key="csv" value="application/csv" /> <entry key="json" value="application/json" /> <entry key="xml" value="application/xml" /> </map> </property> <property name="viewResolvers"> <list> <bean class="org.springframework.web.servlet.view.BeanNameViewResolver" /> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/views/" /> <property name="suffix" value=".jsp"></property> </bean>