有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java SpringMVC<mvc:resources/>SpringXML模式验证?

我被放置在statics文件夹css, js, images,想在web应用程序上添加sources

xml似乎无法解析。 报告错误为:

Cant resolve location statics, Spring Xml mode validaton

打开浏览器选中Sources后,无法加载js, images

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd 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 http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
    <context:component-scan base-package="com.f.dao, com.f.controller, com.f.service, com.f.advice"/>

    <mvc:annotation-driven/>
    <mvc:resources mapping="/statics/" location="statics"/>
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/users/"/>
        <property name="suffix" value=".jsp"/>
    </bean>

    <aop:aspectj-autoproxy/>
</beans>

enter image description here enter image description here

enter image description here


共 (0) 个答案