Weaver 3.1.0a1-D1

com.oldlight.weaver.context
Interface WeaverRequestContext

All Known Implementing Classes:
WeaverRequestContextImpl

public interface WeaverRequestContext

The WeaverRequestContext interfaces manages a request (that is a HTTP GET or POST).

Author:
Paul Harvey

Method Summary
 Object getAttribute(String name)
          Getd a request scoped attribute.
 String getCharacterEncoding()
          Returns the character encoding associated with the request.
 int getContentLength()
          Get the length of the request.
 String getContentType()
          Returns the content type (MIME type) associated with the request.
 Cookie[] getCookies()
          Returns the Cookies associated with the request.
 long getDateHeader(String name)
          Gets a named request header as a Date.
 String getHeader(String name)
          Gets a named request header as a String.
 Enumeration getHeaderNames()
          Gets an Enumeration of the names of all header associated with the request.
 Enumeration getHeaders(String name)
          Get an Enumeration of all the headers with a given name associated with the requested.
 int getIntHeader(String name)
          Gets a name request header as an int.
 Locale getLocale()
          Returns the primary locale associated with the request.
 Enumeration getLocales()
          Returns all locales associated with the request.
 String getParameter(String theName)
          Gets a request parameter.
 String[] getParameterValues(String theName)
          Gets a request parameter.
 WeaverUploadedFile getUploadedFile(String name)
          Get an uploaded file
 void removeAttribute(String name)
          Removes a scoped attribute.
 void setAttribute(String name, Object value)
          Sets a request scoped attribute.
 

Method Detail

getParameter

public String getParameter(String theName)
Gets a request parameter. If the parameter has multiple values then the first is returned.

Parameters:
theName - The name of the parameter.
Returns:
The value of the name parameter - or null if it cannot be found.

getParameterValues

public String[] getParameterValues(String theName)
Gets a request parameter. All values of the parameter are returned.

Parameters:
theName - The name of the parameter to retrieve.
Returns:
The values of the named parameter.

setAttribute

public void setAttribute(String name,
                         Object value)
Sets a request scoped attribute.

Parameters:
name - The name of the attribute to set.
value - The value to set the attribute to.

getAttribute

public Object getAttribute(String name)
Getd a request scoped attribute.

Parameters:
name - The name of the attribute to retrieve.
Returns:
The request attribute value - or null if it cannot be found.

removeAttribute

public void removeAttribute(String name)
Removes a scoped attribute.

Parameters:
name - The name of the attribute to remove.

getContentType

public String getContentType()
Returns the content type (MIME type) associated with the request.

Returns:
The requested content type.

getCharacterEncoding

public String getCharacterEncoding()
Returns the character encoding associated with the request.

Returns:
The requested character encoding.

getLocale

public Locale getLocale()
Returns the primary locale associated with the request.

Returns:
The requests locale.

getLocales

public Enumeration getLocales()
Returns all locales associated with the request.

Returns:
The requested locales.

getCookies

public Cookie[] getCookies()
Returns the Cookies associated with the request.

Returns:
The requested Cookies.

getDateHeader

public long getDateHeader(String name)
Gets a named request header as a Date.

Parameters:
name - The name of the header to retrieve.
Returns:
Value of the named header, or null if the header cannot be found.

getHeader

public String getHeader(String name)
Gets a named request header as a String.

Parameters:
name - The name of the header to retrieve.
Returns:
Value of the named header, or null if the header cannot be found.

getIntHeader

public int getIntHeader(String name)
Gets a name request header as an int.

Parameters:
name - The name of the header to retrieve.
Returns:
Value of the named header, or null if the header cannout be found.

getHeaderNames

public Enumeration getHeaderNames()
Gets an Enumeration of the names of all header associated with the request.

Returns:
The requested Enumeration.

getHeaders

public Enumeration getHeaders(String name)
Get an Enumeration of all the headers with a given name associated with the requested.

Parameters:
name - Name of the headers to retrieve.
Returns:
The requestsed headers.

getContentLength

public int getContentLength()
Get the length of the request.

Returns:
The requested length.

getUploadedFile

public WeaverUploadedFile getUploadedFile(String name)
Get an uploaded file

Parameters:
name - The name of the parameter that contains the uploaded file.
Returns:
The uploaded file, or null if it can't be found.

Copyright ©Paul Harvey