1 16 package org.apache.cocoon.components.jsp; 17 18 import java.io.BufferedReader ; 19 import java.io.IOException ; 20 import java.security.Principal ; 21 import java.util.Enumeration ; 22 import java.util.Locale ; 23 24 import javax.servlet.RequestDispatcher ; 25 import javax.servlet.ServletInputStream ; 26 import javax.servlet.http.Cookie ; 27 import javax.servlet.http.HttpServletRequest ; 28 import javax.servlet.http.HttpSession ; 29 30 33 public class JSPEngineServletRequest implements HttpServletRequest { 34 35 36 private static final String INC_SERVLET_PATH = "javax.servlet.include.servlet_path"; 37 38 private static final String INC_REQUEST_URI = "javax.servlet.include.request_uri"; 39 40 private final HttpServletRequest request; 41 private final String jspFile; 42 43 public JSPEngineServletRequest(HttpServletRequest request, String jspFile) { 44 this.request = request; 45 this.jspFile = jspFile; 46 } 47 public String getAuthType(){ return request.getAuthType(); } 48 public Cookie [] getCookies(){ return request.getCookies(); } 49 public long getDateHeader(String s){ return request.getDateHeader(s); } 50 public String getHeader(String s){ return request.getHeader(s); } 51 public Enumeration getHeaders(String s){ return request.getHeaders(s); } 52 public Enumeration getHeaderNames(){ return request.getHeaderNames(); } 53 public int getIntHeader(String s){ return request.getIntHeader(s); } 54 public String getMethod(){ return request.getMethod(); } 55 public String getPathInfo(){ return request.getPathInfo(); } 56 public String getPathTranslated(){ return request.getPathTranslated(); } 57 public String getContextPath(){ return request.getContextPath(); } 58 public String getQueryString(){ return request.getQueryString(); } 59 public String getRemoteUser(){ return request.getRemoteUser(); } 60 public boolean isUserInRole(String s){ return request.isUserInRole(s); } 61 public Principal getUserPrincipal(){ return request.getUserPrincipal(); } 62 public String getRequestedSessionId(){ return request.getRequestedSessionId(); } 63 public String getRequestURI(){ return request.getRequestURI(); } 64 public String getServletPath(){ return request.getServletPath(); } 65 public HttpSession getSession(boolean flag){ return request.getSession(flag); } 66 public HttpSession getSession(){ return request.getSession(); } 67 public boolean isRequestedSessionIdValid(){ return request.isRequestedSessionIdValid(); } 68 public boolean isRequestedSessionIdFromCookie(){ return request.isRequestedSessionIdFromCookie(); } 69 public boolean isRequestedSessionIdFromURL(){ return request.isRequestedSessionIdFromURL(); } 70 71 public boolean isRequestedSessionIdFromUrl(){ return request.isRequestedSessionIdFromUrl(); } 72 public Object getAttribute(String s){ 73 if (s != null && (s.equals(INC_SERVLET_PATH) || s.equals(INC_REQUEST_URI))) { 74 return jspFile; 75 } 76 return request.getAttribute(s); 77 } 78 public Enumeration getAttributeNames(){ return request.getAttributeNames(); } 79 public String getCharacterEncoding(){ return request.getCharacterEncoding(); } 80 public int getContentLength(){ return request.getContentLength(); } 81 public String getContentType(){ return request.getContentType(); } 82 public ServletInputStream getInputStream() throws IOException { return request.getInputStream(); } 83 public String getParameter(String s){ return request.getParameter(s); } 84 public Enumeration getParameterNames(){ return request.getParameterNames(); } 85 public String [] getParameterValues(String s){ return request.getParameterValues(s); } 86 public String getProtocol(){ return request.getProtocol(); } 87 public String getScheme(){ return request.getScheme(); } 88 public String getServerName(){ return request.getServerName(); } 89 public int getServerPort(){ return request.getServerPort(); } 90 public BufferedReader getReader() 91 throws IOException { return request.getReader(); } 92 public String getRemoteAddr(){ return request.getRemoteAddr(); } 93 public String getRemoteHost(){ return request.getRemoteHost(); } 94 public void setAttribute(String s, Object obj){ request.setAttribute(s,obj); } 95 public void removeAttribute(String s){ request.removeAttribute(s); } 96 public Locale getLocale(){ return request.getLocale(); } 97 public Enumeration getLocales(){ return request.getLocales(); } 98 public boolean isSecure(){ return request.isSecure(); } 99 public RequestDispatcher getRequestDispatcher(String s){ return request.getRequestDispatcher(s); } 100 101 public String getRealPath(String s){ return request.getRealPath(s); } 102 public java.lang.StringBuffer getRequestURL() { return null; } 103 public java.util.Map getParameterMap() { return null; } 104 public void setCharacterEncoding(java.lang.String s) { } 105 } 106 | Popular Tags |