jsp的图片问题 我在myeclipse8.5中可以正常显示图片也可以上传,但是放到tomcat中就不能显示图片,上传也不能!有说是<imagePath>的问题。但是我删掉了还是不行,是怎么回事呢!谢谢大家了! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 具体问题log贴上来看看呗good luck <%@ page language="java" import="java.util.*" pageEncoding="gbk"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>My JSP 'news.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> </head> <body> <% int id=Integer.parseInt(request.getParameter("id").toString()); String title=request.getAttribute("title").toString(); String content=request.getAttribute("content").toString(); String imagePath=request.getAttribute("imagePath").toString(); String date=request.getAttribute("date").toString(); %> <table width="900" height="235" border="0" align="center" bordercolor="#333333" bgcolor="#FFCCCC"> <tr> <th align="center"> <p><font color="#FF0000" style="font-size: 19pt"><%=title %></font> </p></th> </tr> <tr> <td><div align="right"> <h5><a href="shouye.jsp">首页</a> 【发布时间:<%=date %>】</h5> </div></td> </tr> <tr> <td><div align="center"><img height="200px" width="220px" border="" src="<%= imagePath%>" /></div></td> </tr> <tr> <td> <%=content %> </td> </tr> <tr> <td><div align="center"> <%if(id==1){out.print("上一条");}else{ %> <a href="imageNewsCheck.jsp?id=<%=String.valueOf(id-1)%>">上一条</a><%} %> <%for(int i=1;i<=5;i++){ if(i==id){ out.print(id); }else{ %> <a href="imageNewsCheck.jsp?id=<%=i%>"><%=i%></a> <% } } %> <%if(id==5){out.print("下一条");}else{ %> <a href="imageNewsCheck.jsp?id=<%=String.valueOf(id+1)%>">下一条</a> <%}%></div></td> </tr> </table> </body></html>这是显示图片的代码,在tomcat中就是显示不出来! 路径没有问题,是绝对路径。而且他在myeclipse中可以正常显示!有人说是<basepath >问题,我已经删除了为什么还不好使呢! 那个图片的地址是从数据库里读出开的啊,路径没有问题啊!他如果有问题在myeclipse中也不会显示的啊! myeclipse里自带的浏览器和IE是有区别的!你在IE地址栏中看是什么效果,不要说路径不可能有问题!你试都没试。你在IE地址栏中输入输入地址后,如果还是显示不了,那就是路径问题! 求助!weblogic发布失败- - 在myeclipse的java web工程中导入struts2库的问题? xfire的webservice接口问题 Extjs3 struts2 的问题 【求助】统计网页上的信息 jsp 如何取得客户的IP信息 求大家给个最简单的Spring的实例,谢谢大家~~~` eclipse中找不到tomcat首页 请教java和javascript联动,解决下拉框没有被选中问题. JMS问题求助!! 异常处理、数据字典以及初始化 jsp中include file=""路径问题?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'news.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--> </head>
<body>
<% int id=Integer.parseInt(request.getParameter("id").toString());
String title=request.getAttribute("title").toString();
String content=request.getAttribute("content").toString();
String imagePath=request.getAttribute("imagePath").toString();
String date=request.getAttribute("date").toString();
%>
<table width="900" height="235" border="0" align="center" bordercolor="#333333" bgcolor="#FFCCCC">
<tr>
<th align="center">
<p><font color="#FF0000" style="font-size: 19pt"><%=title %></font> </p></th>
</tr>
<tr>
<td><div align="right">
<h5><a href="shouye.jsp">首页</a> 【发布时间:<%=date %>】</h5>
</div></td>
</tr>
<tr>
<td><div align="center"><img height="200px" width="220px" border="" src="<%= imagePath%>" /></div></td>
</tr>
<tr>
<td> <%=content %> </td>
</tr>
<tr>
<td><div align="center">
<%if(id==1){out.print("上一条");}else{ %>
<a href="imageNewsCheck.jsp?id=<%=String.valueOf(id-1)%>">上一条</a><%} %>
<%for(int i=1;i<=5;i++){
if(i==id){
out.print(id);
}else{
%>
<a href="imageNewsCheck.jsp?id=<%=i%>"><%=i%></a>
<%
}
}
%>
<%if(id==5){out.print("下一条");}else{ %>
<a href="imageNewsCheck.jsp?id=<%=String.valueOf(id+1)%>">下一条</a>
<%}%></div></td>
</tr>
</table>
</body>
</html>
这是显示图片的代码,在tomcat中就是显示不出来!
有人说是<basepath >问题,我已经删除了为什么还不好使呢!
你在IE地址栏中看是什么效果,不要说路径不可能有问题!
你试都没试。你在IE地址栏中输入输入地址后,
如果还是显示不了,那就是路径问题!