我有以下目录结构
我的CSS尝试使用图像作为背景
#search-text {
width: 213px;
height: 28px;
padding: 6px 0 0 7px;
border: none;
background: url(../images/img02.jpg) no-repeat left top;
color: #000000;
}
并且在CSS的其他部分正常工作时它不起作用.
Firebug显示应用程序尝试通过URL _http:// localhost:8080 / images / img02.jpg访问图像,并得到404错误
当我尝试直接访问图像时,也会出现此错误.我也尝试过
_http:// localhost:8080 / paygate / images / img02.jpg
_http:// localhost:8080 / paygate / resources / images / img02.jpg
…而且这个错误不会停止跟随我.
当我将CSS文件更改为以下内容时
background: url(images/img02.jpg) no-repeat left top;
警告出现在Web服务器日志中:
WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/paygate/images/img02.jpg] in DispatcherServlet with name 'appServlet'
和Firebug显示URL _http:// localhost:8080 / paygate / images / img02.jpg的404错误
我应该如何组织目录结构,或者应该怎么做才能使图像可访问.谢谢!
附言我正在使用springsource tc服务器作为Web服务器.