I want to pass a variable to ContentList.jsp…. how do I do that? Can I add it to the dispatcher or the request? Is the response a reference? So if I add the parameter to the request object, will it already be accessible within ContentList.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);
}
Merry Christmas!
You can set the parameter by using
then dispatch the request and in JSP you retrieve it with