JAVA-WEB Session02

JAVA-WEB Session02

Professional Development

15 Qs

quiz-placeholder

Similar activities

KIỂM TRA BÀI CŨ

KIỂM TRA BÀI CŨ

KG - Professional Development

10 Qs

Props, State, Event

Props, State, Event

Professional Development

15 Qs

Lesson 9:  BrowserStack, Client-Server Arc, Charles Proxy, UNIX

Lesson 9: BrowserStack, Client-Server Arc, Charles Proxy, UNIX

Professional Development

10 Qs

Công nghệ 5.0

Công nghệ 5.0

KG - Professional Development

10 Qs

Cycle 2: Session 2 Review.

Cycle 2: Session 2 Review.

University - Professional Development

10 Qs

AI Tỉnh đoàn

AI Tỉnh đoàn

Professional Development

10 Qs

Sử dụng hàm tin 7

Sử dụng hàm tin 7

Professional Development

10 Qs

XPath Efectivos.

XPath Efectivos.

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?