JAVA-WEB Session02

JAVA-WEB Session02

Professional Development

15 Qs

quiz-placeholder

Similar activities

NGƯỜI CHIẾN THẮNG

NGƯỜI CHIẾN THẮNG

Professional Development

10 Qs

Ağ Güvenliği

Ağ Güvenliği

Professional Development

10 Qs

SFRP October 2023 Knowledge Check

SFRP October 2023 Knowledge Check

Professional Development

10 Qs

Bộ đề game Quizizz ICT

Bộ đề game Quizizz ICT

KG - Professional Development

15 Qs

Cycle 2: Session 2 Review.

Cycle 2: Session 2 Review.

University - Professional Development

10 Qs

แบบทดสอบหลังเรียนหน่วยที่ 9 Cascading Style Sheets (CSS)

แบบทดสอบหลังเรียนหน่วยที่ 9 Cascading Style Sheets (CSS)

Professional Development

10 Qs

SOLIDWORKS TANDUC

SOLIDWORKS TANDUC

Professional Development

12 Qs

Sử dụng hàm tin 7

Sử dụng hàm tin 7

Professional Development

10 Qs

JAVA-WEB Session02

JAVA-WEB Session02

Assessment

Quiz

Instructional Technology

Professional Development

Easy

Created by

academy rikkei

Used 3+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Trong vòng đời của Servlet, phương thức nào được gọi đầu tiên?

doGet()

 init()

destroy()

 service()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

 Servlet xử lý mỗi yêu cầu thông qua phương thức nào?

execute()

service()

execute()

destroy()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

 Phương thức destroy() trong Servlet được gọi khi nào?

Khi Servlet reload

Khi Servlet khởi tạo

Mỗi khi request được gửi đến Servlet

Khi Servlet container dừng hoạt động

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Dữ liệu trong request được thiết lập bằng request.setAttribute() sẽ :

Tồn tại đến khi Servlet bị hủy

Tồn tại trong 1 request

Lưu trữ vào file log

Đồng bộ với session

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Phương thức doGet() phù hợp xử lý request cho trường hợp nào?

Gửi file đính kèm

Yêu cầu truy vấn để hiển thị dữ liệu

Cần truyền dữ liệu lớn

Gửi thông tin nhạy cảm

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Khi truyền danh sách sinh viên(students) từ Servlet sang JSP bằng RequestDispatcher , chúng ta sử dụng phương thức nào để gửi dữ liệu thông qua request:

request.getAttribute("students",students)

request.setAttribute("students", students)

request.addAttribute("students", students)

request.putAttribute("students", students)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Servlet sau in ra kêt quả gì?

protected void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException {

    res.setContentType("text/html");

    PrintWriter out = res.getWriter();

    out.println("<h1>Hello Servlet</h1>");

}


Lỗi do chưa forward

Trang trắng

Hiển thị ở giao diện "Hello Servlet"

In ra console màn hình console "Hello Servlet"

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?