Subversion Repositories SmartDukaan

Rev

Rev 2147 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2147 Rev 5332
Line 23... Line 23...
23
	}
23
	}
24
	
24
	
25
	
25
	
26
	 // GET /this
26
	 // GET /this
27
	@Action("this")
27
	@Action("this")
28
    public HttpHeaders index() {
28
    public String index() {
29
		this.session.invalidate();
29
		this.session.invalidate();
30
        Cookie[] cookies = request.getCookies();
30
        Cookie[] cookies = request.getCookies();
31
        //boolean foundCookie = false;
31
        //boolean foundCookie = false;
32
        long sessionId = 0;
32
        long sessionId = 0;
33
        
33
        
Line 40... Line 40...
40
	                //foundCookie = true;
40
	                //foundCookie = true;
41
	            }
41
	            }
42
	        }
42
	        }
43
	       }
43
	       }
44
 
44
 
45
        
-
 
46
//		UserContextServiceClient userContextServiceClient;
-
 
47
//		Client client;
-
 
48
//		UserContext context;
45
    	return "index";
49
//		try {
-
 
50
//			userContextServiceClient = new UserContextServiceClient();
-
 
51
//			client = userContextServiceClient.getClient();
-
 
52
//TODO: Commented out since it's not super-critical to compile TestController			
-
 
53
//			if (!foundCookie) {
-
 
54
//	        	// create new session and set the cookies
-
 
55
//	        	context = new UserContext();
-
 
56
//	        	context = client.createContext(context, false);
-
 
57
//	        	sessionId = context.getSessionid();
-
 
58
//	        	
-
 
59
//	        	Cookie loginCookie = new Cookie("sessionId", sessionId+"");
-
 
60
//	        	loginCookie.setComment("For storing session id");
-
 
61
//	        	loginCookie.setMaxAge(24*60*60);
-
 
62
//	        	//loginCookie.setValue("Rajveer");
-
 
63
//	        	response.addCookie(loginCookie);
-
 
64
//			}
-
 
65
//
-
 
66
//	        else{
-
 
67
//	        	context = client.getContextFromId(sessionId, false);
-
 
68
//	        	if(context.getUserState().isIsLoggedIn()){
-
 
69
//	        		System.out.println("User is logged in with user Id  " + context.getId());	
-
 
70
//	        	}
-
 
71
//	        	
-
 
72
//	        }
-
 
73
//	        
-
 
74
//			
-
 
75
//		} catch (Exception e1) {
-
 
76
//			// TODO Auto-generated catch block
-
 
77
//			e1.printStackTrace();
-
 
78
//		}
-
 
79
		
-
 
80
 
-
 
81
        	
-
 
82
        
-
 
83
        
-
 
84
  /*  	
-
 
85
    	Map cookiesMap = new HashMap();
-
 
86
    	cookiesMap.put("USER_ID", loginCookie);
-
 
87
    	setCookiesMap(cookiesMap);
-
 
88
    	
-
 
89
    	log.info( "Cookies map is " + this.getCookiesMap());
-
 
90
    	log.info("CartController.index");
-
 
91
    	
-
 
92
 
-
 
93
 
-
 
94
    	if(getCookiesMap() != null){
-
 
95
    		Cookie loginCookie = (Cookie)getCookiesMap().get("USER_ID");
-
 
96
    		log.info("login cookie name is " + loginCookie.getName() );
-
 
97
    		log.info("login cookie value is " + loginCookie.getValue());
-
 
98
    	}
-
 
99
*/
-
 
100
    	
-
 
101
    	return new DefaultHttpHeaders("index").disableCaching();
-
 
102
    }
46
    }
103
    
47
    
104
    /*	
-
 
105
	@Override
-
 
106
	public void setParameters(Map<String, String[]> reqmap) {
-
 
107
		log.info("setParameters:" + reqmap);
-
 
108
		
-
 
109
		this.reqparams = reqmap;
-
 
110
	}
-
 
111
	*/
-
 
112
    
-
 
113
//	@Override
-
 
114
//	public void setServletRequest(HttpServletRequest request) {
-
 
115
//		this.request = request;
-
 
116
//	}
-
 
117
//
-
 
118
//
-
 
119
//	@Override
-
 
120
//	public void setServletResponse(HttpServletResponse response) {
-
 
121
//		this.response = response;
-
 
122
//		// TODO Auto-generated method stub
-
 
123
//		
-
 
124
//	}
-
 
125
    
-
 
126
}
48
}