2 lxm9322 lxm9322 于 2016.04.11 12:40 提问

jsp页面图片在myeclipse上能正常显示为什么浏览器上不行啊

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<title>My JSP 'left_1.jsp' starting page</title>
<script src="../js/prototype.lite.js" type="text/javascript"></script>
<script src="../js/moo.fx.js" type="text/javascript"></script>
<script src="../js/moo.fx.pack.js" type="text/javascript"></script>

<style type="text/css">

body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.STYLE1 {
font-size: 12px;
color: #FFFFFF;
}
.STYLE3 {
font-size: 12px;
color: #033d61;
}

.menu_title SPAN { FONT-WEIGHT: bold; LEFT: 3px; COLOR: #ffffff; POSITION: relative; TOP: 2px } .menu_title2 SPAN { FONT-WEIGHT: bold; LEFT: 3px; COLOR: #FFCC00; POSITION: relative; TOP: 2px } var he=document.body.clientHeight-105 document.write("<div id=tt style=height:"+he+";overflow:hidden>") function showsubmenu(sid) { whichEl = eval("submenu" + sid); imgmenu = eval("imgmenu" + sid); if (whichEl.style.display == "none") { eval("submenu" + sid + ".style.display=\"\";"); imgmenu.background="/moban/images/main_47.gif"; } else { eval("submenu" + sid + ".style.display=\"none\";"); imgmenu.background="/moban/images/main_48.gif"; } }












  管理菜单








    </table></td>
  </tr>

图片说明图片说明](http://img.ask.csdn.net/upload/201604/11/1460349517_611689.png)65_855328.png)






  业务中心































短信群发




用户资料修改




公司信息管理




其他业务

3个回答

qq_30408111
qq_30408111   2016.04.11 14:08

myeclipse里面的路径有问题把,好好看一下相对路径与绝对路径

qinmengxiao
qinmengxiao   2016.04.11 15:34

你的路径有问题,试着把../改成《%=path%》试试

lxm9322
lxm9322 主要是里面的图片没有显示 我图片路径是这样写的<td height="23" background="/moban/images/main_47.gif" id="imgmenu1" class="menu_title" onMouseOver="this.className='menu_title2';" onClick="showsubmenu(1)" onMouseOut="this.className='menu_title';" style="cursor:hand"><table width="100%" border="0" cellspacing="0" cellpadding="0">在myeclipse中按住ctrl直接能找到图片 但是在问加载时报Failed to load resource: the server responded with a status of 404 (Not Found)
一年多之前 回复
lxm9322
lxm9322   2016.04.11 22:41

在head中加入了一句

lxm9322
lxm9322 <base href=" <%=basePath%>">
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!