R4RIN
Articles
Java 8
MCQS
Spring Boot MCQ Quiz Hub
Spring Boot - Interceptor
Choose a topic to test your knowledge and improve your Spring Boot skills
1. Spring Boot support Interceptor ?
true
false
2. Interceptor in Spring Boot can perform operations under which situations?
Befor sending requets to the controller .
Before sending response to the client .
Both
Only 1
3. Can we use Interceptor to add the request header before sending to the controller ?
Yes
No
4. Can we use interceptor to add response header before sending the response to the client ?
Yes
No
5. Spring Boot -Interceptor to work on it .We need create class supported
@Component
class should implemented HandlerInterceptor interface.
both
None
6. Choose methods in Spring boot -Interceptor -HandlerInterceptor interface
preHandle()
postHandle()
afterCompletion()
All above three
7. Spring Boot Interceptor -HandlerInterface -preHandle() method
always return true -resopnse to the client .
always return true -request to the client .
always return false -resopnse to the client .
always return true -request to the client .
8. postHandle() method arguments are ?
HttpServletRequest request, HttpServletResponse response
Object handler, ModelAndView modelAndView
both
Only 2
9. return type of preHandle()
boolean
void
srting
Any Object
10. To register a Spring boot Interceptor with InterceptorRegistry use
WebMvcConfigurerAdapter
WebSpringBootConfigurerAdapter
WebSpringbootAdapter
None
Submit