PRJ301_-_SU_2024_-_RE_2458.webp
May76

PRJ301_-_SU_2024_-_RE_2458.webp

  • Media owner May76
  • Ngày thêm
Kizspy | Question: 30
(Choose 1 answer)
FUOVERFL
public class MyControllerServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException { String data = "Hello from Controller";request.setAttribute("message", data);RequestDispatcher dispatcher = request.getRequestDispatcher("/myView.jsp");dispatcher.forward(request, response);}
} In the above source code, how to pass message from Controller to JSP for display?
A. Use 'response.sendData("Hello from Controller");'
B. Use 'response.writeAtrribute("message", "Hello from Controller");'
C. Use 'request.set("message", "Hello from Controller");'
D. Use 'request.setAttribute("message", "Hello from Controller");'

Thông tin

Category
PRJ301
Thêm bởi
May76
Ngày thêm
Lượt xem
6,058
Lượt bình luận
38
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom