public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain chain) throws IOException, ServletException {
		response.setContentType("text/html");
		PrintWriter out = response.getWriter();
		String service;
		ServiceDef sd;
		String userEmail;
		Integer sessionId;
		try {
			
		HttpServletRequest req = (HttpServletRequest) request;
		MyHttpServletRequest myRequest=new MyHttpServletRequest(req);
		if(myRequest.getParameter(REQUEST_PARAMETERS.SESSION_ID)!=null){
			sessionId = Integer.valueOf(myRequest.getParameter(REQUEST_PARAMETERS.SESSION_ID));
		}
		else{
			sessionId=null;
		}
		out.println(sessionId);
		service=req.getServletPath();
		service=service.substring(1,service.length());
		ServiceGroupDef group=loadXml();
		userEmail=getUser(req);
		userEmail=userEmail+"@cgi.com";
		out.println(userEmail);
			if(group!=null){
				sd=loadServiceDef(group, service);
				if(sd!=null){
					if(userEmail!=null){
						if (sp.isServReqValid(sd,"surabhi@cgi.com", sessionId)) {
							chain.doFilter(request, response);
							out.print("hiiii");
						}
						else {
							throw new InvalidServiceInvocationException();
						}
					}else{
						out.print("User email is required");
					}
				}else{
					out.print("Service not available!!!");
				}
			}else{
				out.print("service definitions not defined");
			}
		} catch (InvalidServiceInvocationException e) {
			out.println("Invalid service invocation");

		} catch (UserTypeNotValidException e) {
			out.println("UserTypeNotValidException : Should not occur");
		} catch (SessionNotFoundException e) {
			out.println("SessionNotFoundException : Should not occur");
		}
		// RenderResponse r=new RenderResponse();
		// r.render(myResponse);
	}