一
JSP取得Servlet中放入request的List
[java]
/**
* 新聞Servlet
* @author 徐越
*
*/
public class ListServlet extends HttpServlet
{
private static final long serialVersionUID =
private VideoNewsService vs = new VideoNewsServiceImpl();
protected void doGet(HttpServletRequest request
{
doPost(request
}
protected void doPost(HttpServletRequest request
{
List<VideoNews> news = vs
request
request
}
}
/**
* 新聞Servlet
* @author 徐越
*
*/
public class ListServlet extends HttpServlet
{
private static final long serialVersionUID =
private VideoNewsService vs = new VideoNewsServiceImpl();
protected void doGet(HttpServletRequest request
{
doPost(request
}
protected void doPost(HttpServletRequest request
{
List<VideoNews> news = vs
request
request
}
}
[html]
<%@ page language="java" contentType="text/xml; charset=utf
<%@ taglib prefix="c" uri="%>
<?xml version="
<videoNews>
<c:forEach items="${lstnews}" var="n">
<news id="${n
<title>${n
<length>${n
</news>
</c:forEach>
</videoNews>
<%@ page language="java" contentType="text/xml; charset=utf
<%@ taglib prefix="c" uri="%>
<?xml version="
<videoNews>
<c:forEach items="${lstnews}" var="n">
<news id="${n
<title>${n
<length>${n
</news>
</c:forEach>
</videoNews>
二
火狐中報錯
chrome報錯
根據錯誤信息
三
將page
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19951.html