
Spring Web

Quiz
•
Computers
•
Professional Development
•
Hard
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) {
...
}
}
http://localhost:8080/mvc-basic/persons/ showPerson?personId=aa
http://localhost:8080/mvc-basic/persons/ showPerson?personId=105
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()
Similar Resources on Wayground
10 questions
Laravel 1

Quiz
•
Professional Development
7 questions
Arquitectura Web 1

Quiz
•
Professional Development
7 questions
Flutter Maps

Quiz
•
Professional Development
10 questions
MyReskill IoT

Quiz
•
10th Grade - Professi...
14 questions
Ingenio - Full Stack Course - First Quiz

Quiz
•
Professional Development
10 questions
Power BI Day 1 AN

Quiz
•
Professional Development
10 questions
Ai nhanh hơn

Quiz
•
Professional Development
10 questions
SB_Quiz2_Day5

Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade