public void doFilter(ServletRequest req, ServletResponse res, 
			FilterChain chain) throws IOException, ServletException {
		
		String url = "/";
		
		HttpServletRequest request = (HttpServletRequest)req;
		HttpSession session = request.getSession(true);

		if ("purchase".equals(request.getParameter("action"))) {
			
			if (session.getAttribute("loggedInCustomer") != null) { // user logged in
				url += "purchaseController";
			}
			else {
				req.setAttribute("requestAction", "purchase");
				url += "Login.jsp";
			}
			request.getRequestDispatcher(url).forward(req, res);
		}
		else {
			chain.doFilter(req, res);
		}
	}