标题:[求助]一个 servlet 转发问题
取消只看楼主
KoKoK
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-3-21
 问题点数:0 回复次数:0 
[求助]一个 servlet 转发问题

从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" >&nbsp;</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">&nbsp;</td>
</tr>
</table>
</body>
</html>


搜索更多相关主题的帖子: servlet 
2007-03-21 19:37



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-125681-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.091167 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved