JAVA里的jsp网页背景_Java-带CSS的JSP不显示背景图像

我有以下目录结构

我的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服务器.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值