Spring Boot/Spring Boot - Interceptor Sample Test,Sample questions

Question:
Can we use interceptor to add response header  before sending the response to the client ?

1.Yes

2.No


Question:
Can we use Interceptor to add the request header before sending  to the controller ?

1.Yes

2.No


Question:
Choose methods in Spring boot -Interceptor -HandlerInterceptor interface

1.preHandle()

2.postHandle()

3.afterCompletion()

4.All above three


Question:
Interceptor in Spring Boot can perform operations under which situations?

1.Befor sending requets to the controller .

2.Before sending response to the client .

3.Both

4.Only 1


Question:
postHandle() method arguments are ?

1.HttpServletRequest request, HttpServletResponse response

2.Object handler, ModelAndView modelAndView

3.both

4.Only 2


Question:
return type of  preHandle()

1.boolean

2.void

3.srting

4.Any Object


Question:
Spring Boot -Interceptor to work on it .We need create class supported 

1.@Component

2.class should implemented HandlerInterceptor interface.

3.both

4.None


Question:
Spring Boot Interceptor -HandlerInterface -preHandle() method 

1.always return true -resopnse to the client .

2.always return true -request to the client .

3.always return false -resopnse to the client .

4.always return true -request to the client .


Question:
Spring Boot support Interceptor ?

1.true

2.false


Question:
To register a Spring boot Interceptor with InterceptorRegistry  use

1.WebMvcConfigurerAdapter

2.WebSpringBootConfigurerAdapter

3.WebSpringbootAdapter

4.None


More MCQS

  1. Spring Boot Common Test
  2. Spring Boot - Bootstrapping
  3. Spring Boot AOP
  4. Spring Boot - Logging
  5. Spring Boot - Application Properties
  6. Spring Boot - RESTful Web Services
  7. Spring Boot - Exception Handling
  8. Spring Boot - Interceptor
  9. Spring Boot - Servlet Filter
  10. Spring Boot - Tomcat
  11. Spring Boot - File Handling
  12. Spring Boot - Service Components
  13. Spring Boot - Thymeleaf
  14. Spring Boot - CORS
  15. Spring Boot - Internationalization
  16. Spring Boot - Scheduling
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!