REST Annotations Flashcards

1
Q

@RestController

A

Combines @Controller and @ResponseBody, meaning each method in the class returns a JSON/XML response directly (no view is rendered).

@RestController
public class MyRestController {
// Methods to handle HTTP requests
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

@RequestMapping

A

Maps HTTP requests to handler methods in classes or methods.
Works at both the class and method level.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly