1 24 package org.riotfamily.components.context; 25 26 import java.util.HashMap ; 27 import java.util.Map ; 28 29 import javax.servlet.http.HttpServletRequest ; 30 31 import org.riotfamily.common.web.util.ServletUtils; 32 33 public class PageRequestContext { 34 35 private Object key; 36 37 private Map parameters; 38 39 private Map attributes; 40 41 private String method; 42 43 private String pathInfo; 44 45 private String servletPath; 46 47 private String queryString; 48 49 private String requestURI; 50 51 public PageRequestContext(Object key, HttpServletRequest request) { 52 this.key = key; 53 this.method = request.getMethod(); 54 this.pathInfo = request.getPathInfo(); 55 this.servletPath = request.getServletPath(); 56 this.queryString = request.getQueryString(); 57 this.requestURI = request.getRequestURI(); 58 59 this.attributes = ServletUtils.takeAttributesSnapshot(request); 60 this.parameters = new HashMap (request.getParameterMap()); 61 } 62 63 public Object getKey() { 64 return this.key; 65 } 66 67 public Map getAttributes() { 68 return this.attributes; 69 } 70 71 public String getMethod() { 72 return this.method; 73 } 74 75 public Map getParameters() { 76 return this.parameters; 77 } 78 79 public String getPathInfo() { 80 return this.pathInfo; 81 } 82 83 public String getQueryString() { 84 return this.queryString; 85 } 86 87 public String getRequestURI() { 88 return this.requestURI; 89 } 90 91 public String getServletPath() { 92 return this.servletPath; 93 } 94 95 } 96 | Popular Tags |