June 2014
Beginner to intermediate
304 pages
7h 25m
English
For example, consider a situation where you want to show the special offer products page to only those users who have a valid promo code. The others trying to access the special offer products page with an invalid promo code should be redirected to an error page. Achieve this piece of functionality with the help of the interceptor by performing the following steps:
PromoCodeInterceptor under the com.packt.webstore.interceptor package in the source folder src/main/java and add the following code into it:package com.packt.webstore.interceptor; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; ...