| 20399 |
amit.gupta |
1 |
package com.hotspotstore.controllers;
|
|
|
2 |
|
|
|
3 |
|
|
|
4 |
|
|
|
5 |
import java.util.Map;
|
|
|
6 |
|
|
|
7 |
import javax.servlet.http.HttpServletRequest;
|
|
|
8 |
import javax.servlet.http.HttpServletResponse;
|
|
|
9 |
import javax.servlet.http.HttpSession;
|
|
|
10 |
|
|
|
11 |
import org.apache.log4j.Logger;
|
|
|
12 |
import org.apache.struts2.interceptor.ServletRequestAware;
|
|
|
13 |
import org.apache.struts2.interceptor.ServletResponseAware;
|
| 20400 |
amit.gupta |
14 |
import org.apache.struts2.interceptor.SessionAware;
|
| 20399 |
amit.gupta |
15 |
|
|
|
16 |
import com.opensymphony.xwork2.ValidationAwareSupport;
|
|
|
17 |
|
|
|
18 |
/**
|
|
|
19 |
* Base class for all user action handlers i.e. controllers
|
|
|
20 |
*
|
|
|
21 |
* @author rajveer
|
|
|
22 |
*/
|
|
|
23 |
public abstract class BaseController extends ValidationAwareSupport implements
|
| 20400 |
amit.gupta |
24 |
ServletResponseAware, ServletRequestAware, SessionAware {
|
|
|
25 |
private static final long serialVersionUID = 3339523094497219816L;
|
|
|
26 |
protected static Logger log = Logger.getLogger(BaseController.class);
|
|
|
27 |
|
|
|
28 |
protected HttpServletResponse response;
|
|
|
29 |
protected HttpServletRequest request;
|
|
|
30 |
protected HttpSession session;
|
|
|
31 |
protected Map<String, Object> sessionMap;
|
| 20399 |
amit.gupta |
32 |
|
| 20400 |
amit.gupta |
33 |
public void setServletResponse(HttpServletResponse response) {
|
|
|
34 |
this.response = response;
|
|
|
35 |
}
|
| 20399 |
amit.gupta |
36 |
|
| 20400 |
amit.gupta |
37 |
public void setServletRequest(HttpServletRequest request) {
|
|
|
38 |
this.request = request;
|
|
|
39 |
this.session = request.getSession();
|
|
|
40 |
}
|
|
|
41 |
|
|
|
42 |
public void setSession(Map<String, Object> sessionMap) {
|
|
|
43 |
this.sessionMap = sessionMap;
|
|
|
44 |
}
|
| 20427 |
kshitij.so |
45 |
|
|
|
46 |
public String getContext(){
|
|
|
47 |
return request.getContextPath();
|
|
|
48 |
}
|
| 20399 |
amit.gupta |
49 |
}
|