<%String impath=request.getSession().getServletContext().getRealPath("images/");%>
<td height="147" background="<%=impath %>/top02.gif">我的项目webroot下有个images和login.jsp,images真的有top02.gif,我在页面上
<td background="images/top02.gif">,不显示图片,
但是<td background="<%=impath %>/top02.gif">却可以显示图片,
但是别人打我的ip加工程名进入页面后看不到图片,右键看图片路径是
file:///F:/workspace/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/51hiptActing/images/top02.gif 怎么回事呢如何实现我和别人都看得见
2.检查自己所用的web层解决方案,是否挡住了类似.jpg等请求的发送或类似文件的访问
比如iis转tomcat时,比如使用struts2时等等。
<td height="147" background="<%=request.getContextPath() %>/top02.gif">
试试这个