Spring Web

Spring Web

Professional Development

9 Qs

quiz-placeholder

Similar activities

FSW:CH07.T01 -  Design Pattern

FSW:CH07.T01 - Design Pattern

University - Professional Development

9 Qs

Rails Dojo III

Rails Dojo III

Professional Development

8 Qs

General sap

General sap

Professional Development

11 Qs

devfest tişört

devfest tişört

Professional Development

11 Qs

Telegram - SMM takrorlash - Quiz 02

Telegram - SMM takrorlash - Quiz 02

Professional Development

10 Qs

Fajar's Quiz

Fajar's Quiz

Professional Development

13 Qs

Accessories @ Apple

Accessories @ Apple

Professional Development

13 Qs

Full Stack Day-6

Full Stack Day-6

Professional Development

5 Qs

Spring Web

Spring Web

Assessment

Quiz

Computers

Professional Development

Hard

Created by

Ismail LAANAIT

FREE Resource

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does MVC stand for? (Choose one.)

management versus control

model-view-controller

model verbosity clearance

model view conventions

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which Spring library is needed in your classpath to write a full-blown Spring web application? (Choose one.)

spring-core.jar is enough

spring-core.jar and spring-context.jar are enough

spring-web.jar is enough

spring-webmvc.jar is a must because that is where the DispatcherServlet class is

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the @Controller annotation? (Choose one.)

to indicate that the bean is to be encapsulated in a special Web Proxy

to indicate that the class is to be used as a template to create a special type of bean required in a Spring web application to provide handler methods for requests

to declare a class as the configuration class for a Spring web application

4.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Which scopes are web specific? (Choose all that apply.)

SCOPE_SESSION

SCOPE_THREAD

SCOPE_SINGLETON

SCOPE_APPLICATION

SCOPE_REQUEST

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given the following controller class containing a single handler method, which of the following URLs will be handled by that method? (Choose one.)
@Controller
@RequestMapping("/persons")
public class PersonController {
@RequestMapping(value = "/showPerson")
public String show(@RequestParam("personId") Long id, Model model) {
...
}
}

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which class in the following list is the default view resolver in Spring: (Choose one.)

JspResourceViewResolver

ResourceViewResolver

InternalResourceViewResolver

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is wrong with the following controller class declaration? (Choose one.)
@ControllerAdvice
public class PersonsController {
@ExceptionHandler(NotFoundException.class)
@ResponseStatus(HttpStatus.NOT_FOUND)
public ModelAndView handle(NotFoundException ex) {
ModelAndView mav = new ModelAndView();
mav.addObject("problem", ex.getMessage());
mav.setViewName("error");
return mav;
}
}

Nothing.

This is not a controller class declaration, but a special type of bean used for handling exceptions thrown by handler methods.

The handle() method is not allowed to return an instance of ModelAndView

The handler method should be annotated with @RequestMapping or one of its specializations.

8.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Which of the following is true about the @WebMvcTest annotation? (Choose all that apply.)

This annotation is the one to use when a test focuses only on Spring MVC components.

This annotation has the effect of disabling auto-configuration and apply only configuration relevant to MVC tests.

This annotation can be applied to a test class to enable and configure auto-configuration of MockMvc.

9.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When running a Spring Boot MVC test annotated with the following: @SpringBootTest(webEnvironment = SpringBootTest. WebEnvironment.RANDOM_PORT) How can the port value be retrieved? (Choose one.)

Declare a local integer property and annotate it with @LocalServerPort

Declare a local integer property and annotate it with @TestServerPort

Make the test class extend SpringBootWebTest and call the getLocalServerPort()