Adblocker Detected

Adblocker

Quizack provides Online Quiz and Practice MCQs for Free. Please disable your Ad-Blocker so we can earn from ads and keep this project alive.

Spring MVC Skill Assessment

Quizack provides Spring MVC MCQ practice question answers in an interactive format.

Spring MVC MCQ

Learn and practice your skills with our MCQ question answers to improve your knowledge. MCQs list

Start Practice with MCQs

Spring MVC Online Quiz

Quizack 10 minutes test will assess your knowledge and give you comprehensive results along feedback.

Start Quiz
Used by 100s of Jobseekers and students

Used by 100s of Jobseekers and students

Focused questions for skill assessment

Focused questions for skill assessment

Premium questions with correct answers

Premium questions with correct answers

Related Skill Assessment

Free Sample Questions for Spring MVC

Which of the following code samples will get the ServletContext inside an Interceptor?

@Autowired ServletContext context;

request.getSession().getServletContext();

setServletContext(ServletContext context) { this.context = context; }

request.getSession().getServletContext();

Answer:
@Autowired ServletContext context;
request.getSession().getServletContext();

Note: This question has more than 1 correct answers

Given the method below:

@RequestMapping(value = "/foo", method = RequestMethod.GET)

public final String foo(HttpServletRequest request, BindingResult bindResult, ModelMap model) {

    model.addAttribute("abc", 123);

    return "foo";

}

When the view is displayed in the browser, it's URL is "http://mydomain/foo?abc=123".

Which of the following statements is true?

The attribute appears as string name-value pairs in the URL because the @ModelAttribute annotation is used in the controller.


Adding "model.asMap().clear();" will prevent the attribute name-value pair from appearing in the URL.


The attribute name-value pair will be included in the URL, regardless of the use of @ModelAttribute in the controller.


The attribute name-value pair cannot be excluded from being displayed in the URL.


Answer:

The attribute name-value pair will be included in the URL, regardless of the use of @ModelAttribute in the controller.