【发布时间】:2019-04-03 09:13:09
【问题描述】:
我在 servlet.xml 中添加了下面的 mvc:resource 标记,但我的应用程序没有获取任何资源文件。我正在尝试开发基于 xml 的 spring mvc 应用程序。为什么资源文件没有加载?
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/pages/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<bean name="/welcome.htm"
class="com.debasish.common.controller.HelloWorldController" />
<mvc:resources location="/resources/" mapping="/test/**"></mvc:resources>
<mvc:annotation-driven></mvc:annotation-driven>
</beans>
【问题讨论】:
-
你能分享你的整个xml文件吗
标签: spring spring-mvc model-view-controller