Q29.webp
G

Q29.webp

  • Media owner Gojo81
  • Ngày thêm
Question: 29
(Choose 1 answer)
public class CookieExampleServlet extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// TODO: Your code here
}
In the doGet method, how to create a Cookie and send it to the client?
A. Cookie newCookie = new Cookie("username", "john_doe"); response.addCookie(newCookie);
B. response.setCookie("username", "john_doe");
C. request.createCookie("username", "john_doe");
response.sendCookie();
D. Cookie.create("username", "john_doe");
response.writeCookie();

Thông tin

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

Share this media

Back
Bên trên Bottom