0
裏面我只是不知道如何把我的JSP的HTML體內的RequestDispatcher的響應。這是我的模型:RequestDispatcher的HTML體
RequestDispatcher view = request.getRequestDispatcher("/Overview.jsp");
view.forward(request, response);
PrintWriter out= response.getWriter();
response.setContentType("text/html");
if (count!=0){
int i = 1;
while (i <= count){
out.println("<div>Name: "+batch.getName()+"</div>");
i++;
}
}
else{
out.println("<div><font colour=blue>No Batch</font</div>");
}
當我運行的Servlet我JSP看起來是這樣的:
<html>...
<body>
....
</body>
</html>
<div>....
我怎麼能夠把div的身體裏面?
(要顯示將在JSP基於servlet的準備變量來實現頁面的組成,在調用調度),我強烈建議你閱讀[一個關於JSP的好教程](https://docs.oracle.com/javaee/5/tutorial/doc/bnagx.html) – fvu