Appendix B. Pop Quiz Answers

This appendix contains answers to all the pop quizzes that appear in the chapters. Now, let's have a look at the answers to the respective questions.

Chapter 2, Spring MVC Architecture - Architecting Your Web Store

Questions

Answers

Suppose I have a Spring MVC application for library management called BookPedia and I want to map a web request URL http://localhost:8080/BookPedia/category/fiction to a controller's method—how would you form the @RequestMapping annotation?

2.@RequestMapping("/category/fiction")

What is the request path in the following URL: http://localhost:8080/webstore/?

2./

Considering the following servlet mapping, identify the possible matching URLs:

@Override   
protected String[] getServletMappings() {   
   return new String[] { "*.do"};   
}   

3. http://localhost:8080/webstore/welcome.do

Considering the following servlet mapping, identify the possible matching URLs:

@Override    
protected String[] getServletMappings() {    
   return new String[] { "/"};    
}   

4. All the above

In order to identify a class as a controller by Spring, what needs to be done?

4. All of the above.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.207.174