Firebug fancybox_sprite.png找不到404文件

时间:2012-10-23 19:46:39

标签: jquery spring-mvc fancybox

我的项目文件结构在我不知道可能导致错误的原因:

src
test
db
war/
   WEB-INF/
          classes
          css/
             fancybox/
                     jquery.fancybox.css
          images/
                fancybox/
                        fancybox_sprite.png
          js
          lib
          tld
          applicationContext.xml
          servlet.xml
          web.xml
    index.jsp

jquery.fancybox.css有

#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {

    background-image:url(../../images/fancybox/fancybox_sprite.png)
}

我也从萤火虫中得到错误:

获取fancybox_sprite.png找不到404文件 获取fancybox_loading.gif 404找不到文件 GET fancybox_overlay.png未找到404文件

Web.xml中

<?xml version="1.0" encoding="UTF-8"?>

<web-app
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
    id="crimeTrack" version="3.0">

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <context-param>
         <param-name>log4jConfigLocation</param-name> 
         <param-value>/WEB-INF/classes/log4j.properties</param-value>
     </context-param>
     <listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>  </listener> 

     <listener>
          <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> 
     </listener>

     <listener>
          <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
     </listener> 

    <servlet>
        <servlet-name>crimetrack</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>crimetrack</servlet-name>
        <url-pattern>*.htm</url-pattern>
    </servlet-mapping>


    <welcome-file-list>
    <welcome-file>
      index.jsp
    </welcome-file>
    </welcome-file-list>

    <jsp-config>
        <taglib>
            <taglib-uri>/spring</taglib-uri>
            <taglib-location>/WEB-INF/tld/spring-form.tld</taglib-location>
        </taglib>
    </jsp-config>

</web-app>

1 个答案:

答案 0 :(得分:2)

如果您的css包含在某个地方,那么您的路径必须来自此文件。不是来自CSS。 如果它包含在index尝试background-image:url(images/fancybox/fancybox_sprite.png)