| Method from org.apache.tomcat.core.Request Detail: |
public Object getAttribute(String name) {
return attributes.get(name);
}
|
public Enumeration getAttributeNames() {
return attributes.keys();
}
|
public String getAuthType() {
return authType;
}
|
public String getCharacterEncoding() {
if(charEncoding!=null) return charEncoding;
charEncoding=reqA.getCharacterEncoding();
if(charEncoding!=null) return charEncoding;
charEncoding = getCharsetFromContentType(getContentType());
return charEncoding;
}
|
public String getCharsetFromContentType(String type) {
return RequestUtil.getCharsetFromContentType( type );
}
|
public int getContentLength() {
if( contentLength > -1 ) return contentLength;
contentLength = reqA.getContentLength();
if( contentLength > -1 ) return contentLength;
contentLength = getIntHeader("content-length");
return contentLength;
}
|
public String getContentType() {
if(contentType != null) return contentType;
contentType= reqA.getContentType();
if(contentType != null) return contentType;
contentType = getHeader("content-type");
if(contentType != null) return contentType;
// can be null!! -
return contentType;
}
|
public Context getContext() {
return context;
}
|
public Cookie[] getCookies() {
// XXX need to use Cookie[], Vector is not needed
if( ! didCookies ) {
// XXX need a better test
// XXX need to use adapter for hings
didCookies=true;
processCookies();
}
Cookie[] cookieArray = new Cookie[cookies.size()];
for (int i = 0; i < cookies.size(); i ++) {
cookieArray[i] = (Cookie)cookies.elementAt(i);
}
return cookieArray;
// return cookies;
}
|
public long getDateHeader(String name) {
return reqA.getMimeHeaders().getDateHeader(name);
}
|
public HttpServletRequestFacade getFacade() {
return requestFacade;
}
|
public String getHeader(String name) {
return reqA.getHeader(name);
}
|
public Enumeration getHeaderNames() {
return reqA.getHeaderNames();
}
|
public Enumeration getHeaders(String name) {
Vector v = reqA.getMimeHeaders().getHeadersVector(name);
return v.elements();
}
|
public ServletInputStream getInputStream() throws IOException {
return reqA.getInputStream();
}
|
public int getIntHeader(String name) {
return reqA.getMimeHeaders().getIntHeader(name);
}
|
public String getLookupPath() {
return lookupPath;
}
|
public String getMethod() {
return reqA.getMethod();
}
|
public Enumeration getParameterNames() {
if (reqA != null) {
return reqA.getParameterNames();
}
getParameters();
if(!didParameters) {
processFormData(getQueryString());
}
if (!didReadFormData) {
readFormData();
}
return parameters.keys();
}
|
public String[] getParameterValues(String name) {
if (reqA != null) {
return reqA.getParameterValues(name);
}
if(!didParameters) {
String qString=getQueryString();
if(qString!=null) {
processFormData(qString);
}
}
if (!didReadFormData) {
readFormData();
}
return (String[])getParameters().get(name);
}
|
public String getPathInfo() {
return pathInfo;
}
|
public String getProtocol() {
return reqA.getProtocol();
}
|
public String getQueryString() {
if( queryString != null ) return queryString;
return reqA.getQueryString();
}
|
public BufferedReader getReader() throws IOException {
return RequestUtil.getReader( this );
}
|
public String getRemoteAddr() {
return reqA.getRemoteAddr();
}
|
public String getRemoteHost() {
return reqA.getRemoteHost();
}
|
public String getRemoteUser() {
return remoteUser;
}
|
public String getRequestURI() {
if( requestURI!=null) return requestURI;
return reqA.getRequestURI();
}
|
public String getRequestedSessionId() {
return reqSessionId;
}
|
public String getScheme() {
return reqA.getScheme();
}
|
public String getServerName() {
if(serverName!=null) return serverName;
serverName=reqA.getServerName();
if(serverName!=null) return serverName;
String hostHeader = this.getHeader("host");
if (hostHeader != null) {
int i = hostHeader.indexOf(':");
if (i > -1) {
hostHeader = hostHeader.substring(0,i);
}
serverName=hostHeader;
return serverName;
}
// default to localhost - and warn
System.out.println("No server name, defaulting to localhost");
serverName="localhost";
return serverName;
}
|
public int getServerPort() {
return reqA.getServerPort();
}
|
public ServerSession getServerSession(boolean create) {
if (context == null) {
System.out.println("CONTEXT WAS NEVER SET");
return null;
}
if (serverSession == null && create) {
serverSession =
ServerSessionManager.getManager()
.getServerSession(this, response, create);
serverSession.accessed();
}
return serverSession;
}
|
public String getServletPath() {
return servletPath;
}
|
public HttpSession getSession() {
return getSession(true);
}
|
public HttpSession getSession(boolean create) {
getServerSession(create);
ApplicationSession appSession = null;
if (serverSession != null) {
appSession = serverSession.getApplicationSession(context, create);
}
return appSession;
// if (reqSessionId != null) {
// //Session session = context.getSession(reqSessionId);
// //if (session == null) {
// //session = context.createSession(reqSessionId);
// //}
// //return session;
// System.out.println("DANGER, SESSIONS ARE NOT WORKING");
// } else {
// if (create) {
// Session session = serverSession.createSession(response);
// return session;
// } else {
// return null;
// }
// }
}
|
public void processCookies() {
RequestUtil.processCookies( this, cookies );
}
|
public void processFormData(String data) {
didParameters=true;
RequestUtil.processFormData( data, getParameters() );
}
|
public void processFormData(InputStream in,
int contentLength) {
byte[] buf = new byte[contentLength]; // XXX garbage collection!
int read = RequestUtil.readData( in, buf, contentLength );
String s = new String(buf, 0, read);
processFormData(s);
}
|
public void recycle() {
response = null;
context = null;
attributes.clear();
getParameters().clear();
cookies.removeAllElements();
// requestURI = null;
// queryString = null;
contentLength = -1;
contentType = null;
charEncoding = null;
authType = null;
remoteUser = null;
reqSessionId = null;
serverSession = null;
didParameters = false;
didReadFormData = false;
didCookies = false;
if( reqA!=null) reqA.recycle();// XXX avoid double recycle
// moreRequests = false;
}
|
public void removeAttribute(String name) {
attributes.remove(name);
}
|
public void setAttribute(String name,
Object value) {
attributes.put(name, value);
}
|
public void setAuthType(String authType) {
this.authType = authType;
}
|
public void setCharEncoding(String enc) {
this.charEncoding=enc;
}
|
public void setCharacterEncoding(String charEncoding) {
this.charEncoding = charEncoding;
}
|
public void setContentLength(int len) {
this.contentLength=len;
}
|
public void setContentType(String type) {
this.contentType=type;
}
|
public void setContext(Context context) {
this.context = context;
contextPath = context.getPath();
String requestURI = getRequestURI();
lookupPath = requestURI.substring(contextPath.length(),
requestURI.length());
// check for ? string on lookuppath
int qindex = lookupPath.indexOf("?");
if (qindex > -1) {
lookupPath = lookupPath.substring(0, qindex);
}
if (lookupPath.length() < 1) {
lookupPath = "/";
}
}
|
public void setParameters(Hashtable h) {
if(h!=null)
this.parameters=h;
// XXX Should we override query parameters ??
}
|
public void setPathInfo(String pathInfo) {
this.pathInfo = pathInfo;
}
|
public void setQueryString(String queryString) {
this.queryString = queryString;
// catch any parse exceptions
if (reqA != null) {
reqA.setQueryString(queryString);
}
try {
this.parameters = HttpUtils.parseQueryString(queryString);
} catch (Exception e) {
this.getParameters().clear();
}
}
Set query string - will be called by forward |
public void setRequestAdapter(RequestAdapter reqA) {
this.reqA=reqA;
}
|
public void setRequestURI(String r) {
this.requestURI=r;
}
|
public void setRequestedSessionId(String reqSessionId) {
this.reqSessionId = reqSessionId;
}
|
public void setResponse(Response response) {
this.response = response;
}
|
public void setServerName(String serverName) {
this.serverName = serverName;
}
|
public void setServerSession(ServerSession serverSession) {
this.serverSession = serverSession;
}
|
public void setServletPath(String servletPath) {
this.servletPath = servletPath;
}
|
public String unUrlDecode(String data) {
try {
return RequestUtil.URLDecode( data );
} catch (NumberFormatException e) {
String msg=getSM().getString("serverRequest.urlDecode.nfe", data);
throw new IllegalArgumentException(msg);
} catch (StringIndexOutOfBoundsException e) {
String msg=getSM().getString("serverRequest.urlDecode.nfe", data);
throw new IllegalArgumentException(msg);
}
}
|