0
我想將一個變量傳遞給ContentList.jsp ....我該怎麼做?我可以將它添加到調度程序或請求嗎?答案是否是參考?因此,如果我將該參數添加到request
對象中,它是否可以在ContentList.jsp
內訪問?如何將一個參數傳遞給這個.jsp文件?
public void loadView (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
RequestDispatcher dispatcher = request.getRequestDispatcher("ContentList.jsp");
response.setContentType("text/html;charset=UTF-8");
System.out.println("MyServlet::LoadView() success");
dispatcher.forward(request, response);
}
聖誕快樂!