从servlet转发jsp后, jsp页面的图片都不显示了,,直接开JSP页面是显示的, 请问有什么好办法
能从 servlet 转发后 jsp页面的图片正常显示~? 谢谢!
servlet
public class Xianshi1 extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doPost(request, response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
ArrayList list=FirstLeveTitleDB.selectTitleName();
request.setAttribute("name", list);
RequestDispatcher dis=request.getRequestDispatcher("../xianshi.jsp");
dis.forward(request, response);
}
}
jsp
<%@ page language="java" import="java.util.*,accp.com.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">
<!--
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
.style1 {color: #FF6600}
-->
</style>
<title>新闻</title>
</head>
<body>
<table width="1000" >
<tr>
<td height="80" background="tou.gif" > </td>
</tr>
</table>
<table width="1000" height="587" >
<tr>
<td width="200" height="581"valign="top" align="center" bgcolor="#FFFFDF" >
<P><img src="l-fy.gif" width="200" height="12"></P>
<%
for(int i=0;i<list.size();i++){
%>
<font size="2"><a class="style1" href="Edit?uid=<%=list.get(i) %>" ><%=list.get(i) %></a></font><br><br>
<%} %>
<P><img src="l-fy.gif" width="200" height="12"></P>
</td>
<td width="625" background="b.gif"> </td>
</tr>
</table>
</body>
</html>