JavaWeb - Session10

JavaWeb - Session10

Professional Development

17 Qs

quiz-placeholder

Similar activities

QUEST

QUEST

Professional Development

12 Qs

VietNam Gameverse ngày 1

VietNam Gameverse ngày 1

Professional Development

15 Qs

Review of Application Software

Review of Application Software

Professional Development

20 Qs

Exam Prep 2

Exam Prep 2

Professional Development

20 Qs

Html

Html

Professional Development

20 Qs

Pertanyaan Dasar Laboran

Pertanyaan Dasar Laboran

Professional Development

20 Qs

CompTIA A+ Flash Cards (ONT-XSS)

CompTIA A+ Flash Cards (ONT-XSS)

Professional Development

20 Qs

MAP REDUCE

MAP REDUCE

Professional Development

18 Qs

JavaWeb - Session10

JavaWeb - Session10

Assessment

Quiz

Information Technology (IT)

Professional Development

Practice Problem

Easy

Created by

academy rikkei

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

17 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Chú thích nào sau đây được sử dụng để đánh dấu một class là một Spring MVC Controller?

@Component

@Service

@Repository

@Controller

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Chú thích @Autowired trong Spring được sử dụng để làm gì?

Khai báo một bean mới.

Tự động tiêm (inject) các dependencies.

Đánh dấu một phương thức xử lý request.

Cấu hình cơ sở dữ liệu.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Sự khác biệt chính giữa @Controller và @Component là gì?

Không có sự khác biệt, chúng hoàn toàn giống nhau.

@Component là một chú thích chung, trong khi @Controller là một loại @Component chuyên biệt cho tầng web.

@Controller chỉ có thể được sử dụng với các lớp Service.

@Component chỉ được sử dụng cho các lớp Repository.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Chú thích nào được sử dụng để ánh xạ (map) một HTTP POST request tới một phương thức xử lý trong Controller?

@RequestMapping

@GetMapping

@PostMapping

@RequestMapping(method = RequestMethod.GET)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Để nhận giá trị của một tham số từ URL request, ví dụ: /users?id=123, trong phương thức xử lý của Controller, chúng ta sử dụng chú thích nào?

@ModelAttribute

@RequestParam

@RequestBody

@RequestBody

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Đối tượng nào sau đây được sử dụng để truyền dữ liệu từ Controller ra View trong Spring MVC?

HttpServletRequest

HttpSession

Model (hoặc ModelMap, ModelAndView)

ServletContext

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Khi sử dụng ModelAndView để truyền dữ liệu và chỉ định tên View, bạn làm thế nào?

Sử dụng phương thức addObject() và setViewName().

Sử dụng phương thức addAttribute() và setView().

Sử dụng phương thức put() và render().

Không thể thực hiện cả hai việc này cùng lúc với ModelAndView.

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?