首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

springMVC js等文件找不到异常

2012-09-17 
springMVC js等文件找不到错误应用springMVC时如果配置URL映射时如下配置?xml version1.0 encodingU

springMVC js等文件找不到错误

应用springMVC时如果配置URL映射时如下配置

<?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:mvc="http://www.springframework.org/schema/mvc"          xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd             http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">                   <mvc:resources mapping="/javascript/**"         location="/static_resources/javascript/"/>          <mvc:resources mapping="/styles/**"         location="/static_resources/css/"/>          <mvc:resources mapping="/images/**"         location="/static_resources/images/"/>          <mvc:default-servlet-handler />                           <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">              <property name="prefix" value="/WEB-INF/views/"/>              <property name="suffix" value=".jsp"/>       </bean>            </beans>  

这里可以看到我所有的页面引用到/styles/**的资源都从/static_resources/css里面进行查找。


根据以上的两种方法,就可以访问到站点的静态资源了。




热点排行
Bad Request.