I have created a Filter to check the Cookies with request object and forward the request accordingly thanks to this and this question.
Filter
Cookie
forward
Just add these to your web.xml
<filter> <filter-name>myFilter</filter-name> <filter-class>com.examples.myFilter</filter-class> </filter> <filter-mapping> <filter-name>myFilter</filter-name> <url-pattern>/index.html</url-pattern> </filter-mapping>