| Method from org.apache.coyote.tomcat4.CoyoteRequest Detail: |
public void addCookie(Cookie cookie) {
// For compatibility only
int size = 0;
if (cookies != null) {
size = cookies.length;
}
Cookie[] newCookies = new Cookie[size + 1];
for (int i = 0; i < size; i++) {
newCookies[i] = cookies[i];
}
newCookies[size] = cookie;
cookies = newCookies;
}
Add a Cookie to the set of Cookies associated with this Request. |
public void addHeader(String name,
String value) {
// Not used
}
Add a Header to the set of Headers associated with this Request. |
public void addLocale(Locale locale) {
locales.add(locale);
}
Add a Locale to the set of preferred Locales for this Request. The
first added Locale will be the first one returned by getLocales(). |
public void addParameter(String name,
String[] values) {
coyoteRequest.getParameters().addParameterValues(name, values);
}
Add a parameter name and corresponding set of values to this Request.
(This is used when restoring the original request on a form based
login). |
public void clearCookies() {
cookies = null;
}
Clear the collection of Cookies associated with this Request. |
public void clearHeaders() {
// Not used
}
Clear the collection of Headers associated with this Request. |
public void clearLocales() {
locales.clear();
}
Clear the collection of Locales associated with this Request. |
public void clearParameters() {
// Not used
}
Clear the collection of parameters associated with this Request. |
public ServletInputStream createInputStream() throws IOException {
return inputStream;
}
Create and return a ServletInputStream to read the content
associated with this Request. |
protected HttpSession doGetSession(boolean create) {
// There cannot be a session if no context has been assigned yet
if (context == null)
return (null);
// Return the current session if it exists and is valid
if ((session != null) && !session.isValid())
session = null;
if (session != null)
return (session.getSession());
// Return the requested session if it exists and is valid
Manager manager = null;
if (context != null)
manager = context.getManager();
if (manager == null)
return (null); // Sessions are not supported
if (requestedSessionId != null) {
try {
session = manager.findSession(requestedSessionId);
} catch (IOException e) {
session = null;
}
if ((session != null) && !session.isValid())
session = null;
if (session != null) {
return (session.getSession());
}
}
// Create a new session if requested and the response is not committed
if (!create)
return (null);
if ((context != null) && (response != null) &&
context.getCookies() &&
response.getResponse().isCommitted()) {
throw new IllegalStateException
(sm.getString("coyoteRequest.sessionCreateCommitted"));
}
session = manager.createSession();
// Creating a new session cookie based on that session
if ((session != null) && (getContext() != null)
&& getContext().getCookies()) {
Cookie cookie = new Cookie(Globals.SESSION_COOKIE_NAME,
session.getId());
cookie.setMaxAge(-1);
String contextPath = null;
if (context != null)
contextPath = context.getPath();
if ((contextPath != null) && (contextPath.length() > 0))
cookie.setPath(contextPath);
else
cookie.setPath("/");
if (isSecure())
cookie.setSecure(true);
((HttpServletResponse) response).addCookie(cookie);
}
if (session != null)
return (session.getSession());
else
return (null);
}
|
public void finishRequest() throws IOException {
// The reader and input stream don't need to be closed
}
Perform whatever actions are required to flush and close the input
stream or reader, in a single operation. |
public Object getAttribute(String name) {
Object attr=attributes.get(name);
if(attr!=null)
return(attr);
attr = coyoteRequest.getAttribute(name);
if(attr != null) {
attributes.put(name, attr);
return attr;
}
// XXX Should move to Globals
if(Constants.SSL_CERTIFICATE_ATTR.equals(name)) {
coyoteRequest.action(ActionCode.ACTION_REQ_SSL_CERTIFICATE, null);
attr = getAttribute(Globals.CERTIFICATES_ATTR);
if(attr != null)
attributes.put(name, attr);
}
return attr;
}
Return the specified request attribute if it exists; otherwise, return
null. |
public Enumeration getAttributeNames() {
return (new Enumerator(attributes.keySet()));
}
Return the names of all request attributes for this Request, or an
empty Enumeration if there are none. |
public String getAuthType() {
return (authType);
}
Return the authentication type used for this Request. |
public String getAuthorization() {
return (this.authorization);
}
Return the authorization credentials sent with this request. |
public String getCharacterEncoding() {
return (coyoteRequest.getCharacterEncoding());
}
Return the character encoding for this Request. |
public Connector getConnector() {
return (this.connector);
}
Return the Connector through which this Request was received. |
public int getContentLength() {
return (coyoteRequest.getContentLength());
}
Return the content length for this Request. |
public String getContentType() {
return (coyoteRequest.getContentType());
}
Return the content type for this Request. |
public Context getContext() {
return (this.context);
}
Return the Context within which this Request is being processed. |
public String getContextPath() {
return (contextPath);
}
Return the portion of the request URI used to select the Context
of the Request. |
public Cookie[] getCookies() {
return cookies;
}
Return the set of Cookies received with this Request. |
public Request getCoyoteRequest() {
return (this.coyoteRequest);
}
|
public long getDateHeader(String name) {
String value = getHeader(name);
if (value == null)
return (-1L);
// Work around a bug in SimpleDateFormat in pre-JDK1.2b4
// (Bug Parade bug #4106807)
value += " ";
// Attempt to convert the date header in a variety of formats
for (int i = 0; i < formats.length; i++) {
try {
Date date = formats[i].parse(value);
return (date.getTime());
} catch (ParseException e) {
;
}
}
throw new IllegalArgumentException(value);
}
Return the value of the specified date header, if any; otherwise
return -1. |
public String getDecodedRequestURI() {
return (coyoteRequest.decodedURI().toString());
}
Get the decoded request URI. |
public String getHeader(String name) {
return coyoteRequest.getHeader(name);
}
Return the first value of the specified header, if any; otherwise,
return null |
public Enumeration getHeaderNames() {
return coyoteRequest.getMimeHeaders().names();
}
Return the names of all headers received with this request. |
public Enumeration getHeaders(String name) {
return coyoteRequest.getMimeHeaders().values(name);
}
Return all of the values of the specified header, if any; otherwise,
return an empty enumeration. |
public String getInfo() {
return (info);
}
Return descriptive information about this Request implementation and
the corresponding version number, in the format
<description>/<version>. |
public ServletInputStream getInputStream() throws IOException {
if (usingReader)
throw new IllegalStateException
(sm.getString("coyoteRequest.getInputStream.ise"));
usingInputStream = true;
return inputStream;
}
Return the servlet input stream for this Request. The default
implementation returns a servlet input stream created by
createInputStream(). |
public int getIntHeader(String name) {
String value = getHeader(name);
if (value == null) {
return (-1);
} else {
return (Integer.parseInt(value));
}
}
Return the value of the specified header as an integer, or -1 if there
is no such header for this request. |
public Locale getLocale() {
if (!localesParsed)
parseLocales();
if (locales.size() > 0) {
return ((Locale) locales.get(0));
} else {
return (defaultLocale);
}
}
Return the preferred Locale that the client will accept content in,
based on the value for the first Accept-Language header
that was encountered. If the request did not specify a preferred
language, the server's default Locale is returned. |
public Enumeration getLocales() {
if (!localesParsed)
parseLocales();
if (locales.size() > 0)
return (new Enumerator(locales));
ArrayList results = new ArrayList();
results.add(defaultLocale);
return (new Enumerator(results));
}
Return the set of preferred Locales that the client will accept
content in, based on the values for any Accept-Language
headers that were encountered. If the request did not specify a
preferred language, the server's default Locale is returned. |
public String getMethod() {
return coyoteRequest.method().toString();
}
Return the HTTP request method used in this Request. |
public Object getNote(String name) {
return (notes.get(name));
}
Return the object bound with the specified name to the internal notes
for this request, or null if no such binding exists. |
public Iterator getNoteNames() {
return (notes.keySet().iterator());
}
Return an Iterator containing the String names of all notes bindings
that exist for this request. |
public String getParameter(String name) {
if (!requestParametersParsed)
parseRequestParameters();
return coyoteRequest.getParameters().getParameter(name);
}
Return the value of the specified request parameter, if any; otherwise,
return null. If there is more than one value defined,
return only the first one. |
public Map getParameterMap() {
if (parameterMap.isLocked())
return parameterMap;
Enumeration paramNames = getParameterNames();
while (paramNames.hasMoreElements()) {
String name = paramNames.nextElement().toString();
String[] values = getParameterValues(name);
parameterMap.put(name, values);
}
parameterMap.setLocked(true);
return parameterMap;
}
Returns a Map of the parameters of this request.
Request parameters are extra information sent with the request.
For HTTP servlets, parameters are contained in the query string
or posted form data. |
public Enumeration getParameterNames() {
if (!requestParametersParsed)
parseRequestParameters();
return coyoteRequest.getParameters().getParameterNames();
}
Return the names of all defined request parameters for this request. |
public String[] getParameterValues(String name) {
if (!requestParametersParsed)
parseRequestParameters();
return coyoteRequest.getParameters().getParameterValues(name);
}
Return the defined values for the specified request parameter, if any;
otherwise, return null. |
public String getPathInfo() {
return (pathInfo);
}
Return the path information associated with this Request. |
public String getPathTranslated() {
if (context == null)
return (null);
if (pathInfo == null) {
return (null);
} else {
return (context.getServletContext().getRealPath(pathInfo));
}
}
Return the extra path information for this request, translated
to a real path. |
public String getProtocol() {
return coyoteRequest.protocol().toString();
}
Return the protocol and version used to make this Request. |
public String getQueryString() {
String queryString = coyoteRequest.queryString().toString();
if (queryString.equals("")) {
return (null);
} else {
return queryString;
}
}
Return the query string associated with this request. |
public BufferedReader getReader() throws IOException {
if (usingInputStream)
throw new IllegalStateException
(sm.getString("coyoteRequest.getReader.ise"));
usingReader = true;
if (reader == null) {
String encoding = getCharacterEncoding();
if (encoding == null) {
encoding =
org.apache.coyote.Constants.DEFAULT_CHARACTER_ENCODING;
}
InputStreamReader r = new InputStreamReader(inputStream, encoding);
reader = new BufferedReader(r);
}
return (reader);
}
Read the Reader wrapping the input stream for this Request. The
default implementation wraps a BufferedReader around the
servlet input stream returned by createInputStream(). |
public String getRealPath(String path) {
if (context == null)
return (null);
ServletContext servletContext = context.getServletContext();
if (servletContext == null)
return (null);
else {
try {
return (servletContext.getRealPath(path));
} catch (IllegalArgumentException e) {
return (null);
}
}
} Deprecated! As - of version 2.1 of the Java Servlet API, use
ServletContext.getRealPath().
Return the real path of the specified virtual path. |
public String getRemoteAddr() {
if (remoteAddr == null) {
if (socket != null) {
InetAddress inet = socket.getInetAddress();
remoteAddr = inet.getHostAddress();
} else {
coyoteRequest.action
(ActionCode.ACTION_REQ_HOST_ADDR_ATTRIBUTE, coyoteRequest);
remoteAddr = coyoteRequest.remoteAddr().toString();
}
}
return remoteAddr;
}
Return the remote IP address making this Request. |
public String getRemoteHost() {
if (remoteHost == null) {
if (!connector.getEnableLookups()) {
remoteHost = getRemoteAddr();
} else if (socket != null) {
InetAddress inet = socket.getInetAddress();
remoteHost = inet.getHostName();
} else {
coyoteRequest.action
(ActionCode.ACTION_REQ_HOST_ATTRIBUTE, coyoteRequest);
remoteHost = coyoteRequest.remoteHost().toString();
}
}
return remoteHost;
}
Return the remote host name making this Request. |
public String getRemoteUser() {
if (userPrincipal != null) {
return (userPrincipal.getName());
} else {
return (null);
}
}
Return the name of the remote user that has been authenticated
for this Request. |
public ServletRequest getRequest() {
if (facade == null) {
facade = new CoyoteRequestFacade(this);
}
return (facade);
}
Return the ServletRequest for which this object
is the facade. This method must be implemented by a subclass. |
public RequestDispatcher getRequestDispatcher(String path) {
if (context == null)
return (null);
// If the path is already context-relative, just pass it through
if (path == null)
return (null);
else if (path.startsWith("/"))
return (context.getServletContext().getRequestDispatcher(path));
// Convert a request-relative path to a context-relative one
String servletPath = (String) getAttribute(Globals.SERVLET_PATH_ATTR);
if (servletPath == null)
servletPath = getServletPath();
// Add the path info, if there is any
String pathInfo = getPathInfo();
String requestPath = null;
if (pathInfo == null) {
requestPath = servletPath;
} else {
requestPath = servletPath + pathInfo;
}
int pos = requestPath.lastIndexOf('/");
String relative = null;
if (pos >= 0) {
relative = RequestUtil.normalize
(requestPath.substring(0, pos + 1) + path);
} else {
relative = RequestUtil.normalize(requestPath + path);
}
return (context.getServletContext().getRequestDispatcher(relative));
}
Return a RequestDispatcher that wraps the resource at the specified
path, which may be interpreted as relative to the current request path. |
public String getRequestURI() {
return coyoteRequest.requestURI().toString();
}
Return the request URI for this request. |
public StringBuffer getRequestURL() {
StringBuffer url = new StringBuffer();
String scheme = getScheme();
int port = getServerPort();
if (port < 0)
port = 80; // Work around java.net.URL bug
url.append(scheme);
url.append("://");
url.append(getServerName());
if ((scheme.equals("http") && (port != 80))
|| (scheme.equals("https") && (port != 443))) {
url.append(':");
url.append(port);
}
url.append(getRequestURI());
return (url);
}
Reconstructs the URL the client used to make the request.
The returned URL contains a protocol, server name, port
number, and server path, but it does not include query
string parameters.
Because this method returns a StringBuffer,
not a String, you can modify the URL easily,
for example, to append query parameters.
This method is useful for creating redirect messages and
for reporting errors. |
public String getRequestedSessionId() {
return (requestedSessionId);
}
Return the session identifier included in this request, if any. |
public Response getResponse() {
return (this.response);
}
Return the Response with which this Request is associated. |
public String getScheme() {
return (coyoteRequest.scheme().toString());
}
Return the scheme used to make this Request. |
public String getServerName() {
return (coyoteRequest.serverName().toString());
}
Return the server name responding to this Request. |
public int getServerPort() {
return (coyoteRequest.getServerPort());
}
Return the server port responding to this Request. |
public String getServletPath() {
return (servletPath);
}
Return the portion of the request URI used to select the servlet
that will process this request. |
public HttpSession getSession() {
return (getSession(true));
}
Return the session associated with this Request, creating one
if necessary. |
public HttpSession getSession(boolean create) {
if (System.getSecurityManager() != null) {
PrivilegedGetSession dp = new PrivilegedGetSession(create);
return (HttpSession) AccessController.doPrivileged(dp);
}
return doGetSession(create);
}
Return the session associated with this Request, creating one
if necessary and requested. |
public Socket getSocket() {
return (socket);
}
Return the Socket (if any) through which this Request was received.
This should only be used to access underlying state
information about this Socket, such as the SSLSession associated with
an SSLSocket. |
public InputStream getStream() {
return inputStream;
}
Return the input stream associated with this Request. |
protected B2CConverter getURIConverter() {
return URIConverter;
}
Return the URI converter. |
public Principal getUserPrincipal() {
return (userPrincipal);
}
Return the principal that has been authenticated for this Request. |
public Wrapper getWrapper() {
return (this.wrapper);
}
Return the Wrapper within which this Request is being processed. |
public boolean isRequestedSessionIdFromCookie() {
if (requestedSessionId != null)
return (requestedSessionCookie);
else
return (false);
}
Return true if the session identifier included in this
request came from a cookie. |
public boolean isRequestedSessionIdFromURL() {
if (requestedSessionId != null)
return (requestedSessionURL);
else
return (false);
}
Return true if the session identifier included in this
request came from the request URI. |
public boolean isRequestedSessionIdFromUrl() {
return (isRequestedSessionIdFromURL());
} Deprecated! As - of Version 2.1 of the Java Servlet API, use
isRequestedSessionIdFromURL() instead.
Return true if the session identifier included in this
request came from the request URI. |
public boolean isRequestedSessionIdValid() {
if (requestedSessionId == null)
return (false);
if (context == null)
return (false);
Manager manager = context.getManager();
if (manager == null)
return (false);
Session session = null;
try {
session = manager.findSession(requestedSessionId);
} catch (IOException e) {
session = null;
}
if ((session != null) && session.isValid())
return (true);
else
return (false);
}
Return true if the session identifier included in this
request identifies a valid session. |
public boolean isSecure() {
return (secure);
}
Was this request received on a secure connection? |
public boolean isUserInRole(String role) {
// Have we got an authenticated principal at all?
if (userPrincipal == null)
return (false);
// Identify the Realm we will use for checking role assignmenets
if (context == null)
return (false);
Realm realm = context.getRealm();
if (realm == null)
return (false);
// Check for a role alias defined in a < security-role-ref > element
if (wrapper != null) {
String realRole = wrapper.findSecurityReference(role);
if ((realRole != null) &&
realm.hasRole(userPrincipal, realRole))
return (true);
}
// Check for a role defined directly as a < security-role >
return (realm.hasRole(userPrincipal, role));
}
Return true if the authenticated user principal
possesses the specified role name. |
protected void parseLocales() {
localesParsed = true;
Enumeration values = getHeaders("accept-language");
while (values.hasMoreElements()) {
String value = values.nextElement().toString();
parseLocalesHeader(value);
}
}
|
protected void parseLocalesHeader(String value) {
// Store the accumulated languages that have been requested in
// a local collection, sorted by the quality value (so we can
// add Locales in descending order). The values will be ArrayLists
// containing the corresponding Locales to be added
TreeMap locales = new TreeMap();
// Preprocess the value to remove all whitespace
int white = value.indexOf(' ");
if (white < 0)
white = value.indexOf('\t");
if (white >= 0) {
StringBuffer sb = new StringBuffer();
int len = value.length();
for (int i = 0; i < len; i++) {
char ch = value.charAt(i);
if ((ch != ' ") && (ch != '\t"))
sb.append(ch);
}
value = sb.toString();
}
// Process each comma-delimited language specification
parser.setString(value); // ASSERT: parser is available to us
int length = parser.getLength();
while (true) {
// Extract the next comma-delimited entry
int start = parser.getIndex();
if (start >= length)
break;
int end = parser.findChar(',");
String entry = parser.extract(start, end).trim();
parser.advance(); // For the following entry
// Extract the quality factor for this entry
double quality = 1.0;
int semi = entry.indexOf(";q=");
if (semi >= 0) {
try {
quality = Double.parseDouble(entry.substring(semi + 3));
} catch (NumberFormatException e) {
quality = 0.0;
}
entry = entry.substring(0, semi);
}
// Skip entries we are not going to keep track of
if (quality < 0.00005)
continue; // Zero (or effectively zero) quality factors
if ("*".equals(entry))
continue; // FIXME - "*" entries are not handled
// Extract the language and country for this entry
String language = null;
String country = null;
String variant = null;
int dash = entry.indexOf('-");
if (dash < 0) {
language = entry;
country = "";
variant = "";
} else {
language = entry.substring(0, dash);
country = entry.substring(dash + 1);
int vDash = country.indexOf('-");
if (vDash > 0) {
String cTemp = country.substring(0, vDash);
variant = country.substring(vDash + 1);
country = cTemp;
} else {
variant = "";
}
}
// Add a new Locale to the list of Locales for this quality level
Locale locale = new Locale(language, country, variant);
Double key = new Double(-quality); // Reverse the order
ArrayList values = (ArrayList) locales.get(key);
if (values == null) {
values = new ArrayList();
locales.put(key, values);
}
values.add(locale);
}
// Process the quality values in highest- >lowest order (due to
// negating the Double value when creating the key)
Iterator keys = locales.keySet().iterator();
while (keys.hasNext()) {
Double key = (Double) keys.next();
ArrayList list = (ArrayList) locales.get(key);
Iterator values = list.iterator();
while (values.hasNext()) {
Locale locale = (Locale) values.next();
addLocale(locale);
}
}
}
Parse accept-language header value. |
protected void parseRequestParameters() {
requestParametersParsed = true;
Parameters parameters = coyoteRequest.getParameters();
String enc = coyoteRequest.getCharacterEncoding();
boolean useBodyEncodingForURI = connector.getUseBodyEncodingForURI();
if (enc != null) {
parameters.setEncoding(enc);
if (useBodyEncodingForURI) {
parameters.setQueryStringEncoding(enc);
}
} else {
parameters.setEncoding
(org.apache.coyote.Constants.DEFAULT_CHARACTER_ENCODING);
if (useBodyEncodingForURI) {
parameters.setQueryStringEncoding
(org.apache.coyote.Constants.DEFAULT_CHARACTER_ENCODING);
}
}
parameters.handleQueryParameters();
if (usingInputStream || usingReader)
return;
if (!getMethod().equalsIgnoreCase("POST"))
return;
String contentType = getContentType();
if (contentType == null)
contentType = "";
int semicolon = contentType.indexOf(';");
if (semicolon >= 0) {
contentType = contentType.substring(0, semicolon).trim();
} else {
contentType = contentType.trim();
}
if (!("application/x-www-form-urlencoded".equals(contentType)))
return;
int len = getContentLength();
if (len > 0) {
try {
byte[] formData = null;
if (len < CACHED_POST_LEN) {
if (postData == null)
postData = new byte[CACHED_POST_LEN];
formData = postData;
} else {
formData = new byte[len];
}
int actualLen = readPostBody(formData, len);
if (actualLen == len) {
parameters.processParameters(formData, 0, len);
}
} catch (Throwable t) {
; // Ignore
}
}
}
Parse request parameters. |
protected int readPostBody(byte[] body,
int len) throws IOException {
int offset = 0;
do {
int inputLen = getStream().read(body, offset, len - offset);
if (inputLen < = 0) {
return offset;
}
offset += inputLen;
} while ((len - offset) > 0);
return len;
}
Read post body in an array. |
public void recycle() {
// --------------------------------------------------------- Public Methods
context = null;
wrapper = null;
authorization = null;
authType = null;
usingInputStream = false;
usingReader = false;
contextPath = "";
pathInfo = null;
servletPath = null;
reader = null;
inputStream.recycle();
userPrincipal = null;
sessionParsed = false;
authorization = null;
requestParametersParsed = false;
locales.clear();
localesParsed = false;
secure = false;
remoteAddr = null;
remoteHost = null;
attributes.clear();
notes.clear();
cookies = null;
session = null;
requestedSessionCookie = false;
requestedSessionId = null;
requestedSessionURL = false;
parameterMap.setLocked(false);
parameterMap.clear();
if (facade != null) {
facade.clear();
facade = null;
}
}
Release all object references, and initialize instance variables, in
preparation for reuse of this object. |
public void removeAttribute(String name) {
attributes.remove(name);
}
Remove the specified request attribute if it exists. |
public void removeNote(String name) {
notes.remove(name);
}
Remove any object bound to the specified name in the internal notes
for this request. |
public void setAttribute(String name,
Object value) {
// Name cannot be null
if (name == null)
throw new IllegalArgumentException
(sm.getString("coyoteRequest.setAttribute.namenull"));
// Null value is the same as removeAttribute()
if (value == null) {
removeAttribute(name);
return;
}
attributes.put(name, value);
}
Set the specified request attribute to the specified value. |
public void setAuthType(String type) {
this.authType = type;
}
Set the authentication type used for this request, if any; otherwise
set the type to null. Typical values are "BASIC",
"DIGEST", or "SSL". |
public void setAuthorization(String authorization) {
this.authorization = authorization;
}
Set the authorization credentials sent with this request. |
public void setCharacterEncoding(String enc) throws UnsupportedEncodingException {
// Ensure that the specified encoding is valid
byte buffer[] = new byte[1];
buffer[0] = (byte) 'a";
String dummy = new String(buffer, enc);
// Save the validated encoding
coyoteRequest.setCharacterEncoding(enc);
}
Overrides the name of the character encoding used in the body of
this request. This method must be called prior to reading request
parameters or reading input using getReader(). |
public void setConnector(Connector connector) {
this.connector = (CoyoteConnector) connector;
}
Set the Connector through which this Request was received. |
public void setContentLength(int length) {
// Not used
}
Set the content length associated with this Request. |
public void setContentType(String type) {
// Not used
}
Set the content type (and optionally the character encoding)
associated with this Request. For example,
text/html; charset=ISO-8859-4. |
public void setContext(Context context) {
this.context = context;
}
Set the Context within which this Request is being processed. This
must be called as soon as the appropriate Context is identified, because
it identifies the value to be returned by getContextPath(),
and thus enables parsing of the request URI. |
public void setContextPath(String path) {
if (path == null) {
this.contextPath = "";
} else {
this.contextPath = path;
}
}
Set the context path for this Request. This will normally be called
when the associated Context is mapping the Request to a particular
Wrapper. |
public void setCookies(Cookie[] cookies) {
this.cookies = cookies;
}
Set the set of cookies recieved with this Request. |
public void setCoyoteRequest(Request coyoteRequest) {
this.coyoteRequest = coyoteRequest;
inputStream.setRequest(coyoteRequest);
}
|
public void setDecodedRequestURI(String uri) {
// Not used
}
Set the decoded request URI. |
public void setMethod(String method) {
// Not used
}
Set the HTTP request method used for this Request. |
public void setNote(String name,
Object value) {
notes.put(name, value);
}
Bind an object to a specified name in the internal notes associated
with this request, replacing any existing binding for this name. |
public void setPathInfo(String path) {
this.pathInfo = path;
}
Set the path information for this Request. This will normally be called
when the associated Context is mapping the Request to a particular
Wrapper. |
public void setProtocol(String protocol) {
// Not used
}
Set the protocol name and version associated with this Request. |
public void setQueryString(String query) {
// Not used
}
Set the query string for this Request. This will normally be called
by the HTTP Connector, when it parses the request headers. |
public void setRemoteAddr(String remoteAddr) {
// Not used
}
Set the IP address of the remote client associated with this Request. |
public void setRemoteHost(String remoteHost) {
// Not used
}
Set the fully qualified name of the remote client associated with this
Request. |
public void setRequestURI(String uri) {
// Not used
}
Set the unparsed request URI for this Request. This will normally be
called by the HTTP Connector, when it parses the request headers. |
public void setRequestedSessionCookie(boolean flag) {
this.requestedSessionCookie = flag;
}
Set a flag indicating whether or not the requested session ID for this
request came in through a cookie. This is normally called by the
HTTP Connector, when it parses the request headers. |
public void setRequestedSessionId(String id) {
this.requestedSessionId = id;
}
Set the requested session ID for this request. This is normally called
by the HTTP Connector, when it parses the request headers. |
public void setRequestedSessionURL(boolean flag) {
this.requestedSessionURL = flag;
}
Set a flag indicating whether or not the requested session ID for this
request came in through a URL. This is normally called by the
HTTP Connector, when it parses the request headers. |
public void setResponse(Response response) {
this.response = response;
}
Set the Response with which this Request is associated. |
public void setScheme(String scheme) {
// Not used
}
Set the name of the scheme associated with this request. Typical values
are http, https, and ftp. |
public void setSecure(boolean secure) {
this.secure = secure;
}
Set the value to be returned by isSecure()
for this Request. |
public void setServerName(String name) {
coyoteRequest.serverName().setString(name);
}
Set the name of the server (virtual host) to process this request. |
public void setServerPort(int port) {
coyoteRequest.setServerPort(port);
}
Set the port number of the server to process this request. |
public void setServletPath(String path) {
this.servletPath = path;
}
Set the servlet path for this Request. This will normally be called
when the associated Context is mapping the Request to a particular
Wrapper. |
public void setSocket(Socket socket) {
this.socket = socket;
remoteHost = null;
remoteAddr = null;
}
Set the Socket (if any) through which this Request was received. |
public void setStream(InputStream stream) {
// Ignore
}
Set the input stream associated with this Request. |
protected void setURIConverter(B2CConverter URIConverter) {
this.URIConverter = URIConverter;
}
|
public void setUserPrincipal(Principal principal) {
this.userPrincipal = principal;
}
Set the Principal who has been authenticated for this Request. This
value is also used to calculate the value to be returned by the
getRemoteUser() method. |
public void setWrapper(Wrapper wrapper) {
this.wrapper = wrapper;
}
Set the Wrapper within which this Request is being processed. This
must be called as soon as the appropriate Wrapper is identified, and
before the Request is ultimately passed to an application servlet. |