org.openejb.webadmin
Interface HttpRequest

All Superinterfaces:
Serializable
All Known Implementing Classes:
HttpRequestImpl

public interface HttpRequest
extends Serializable

An interface to take care of HTTP Requests. It parses headers, content, form and url parameters.


Field Summary
static int CONNECT
          the HTTP CONNECT type
static int DELETE
          the HTTP DELETE type
static int GET
          the HTTP GET type
static int HEAD
          the HTTP HEAD type
static String HEADER_ACCEPT
          the Accept header
static String HEADER_ACCEPT_ENCODING
          the Accept-Encoding header
static String HEADER_ACCEPT_LANGUAGE
          the Accept-Language header
static String HEADER_CACHE_CONTROL
          the Cache-Control header
static String HEADER_CONNECTION
          the Connection header
static String HEADER_CONTENT_LENGTH
          the Content-Length header
static String HEADER_CONTENT_TYPE
          the Content-Type header
static String HEADER_COOKIE
          the Cookie header
static String HEADER_HOST
          the Host header
static String HEADER_SET_COOKIE
          the Set-Cookie header
static String HEADER_USER_AGENT
          the User-Agent header
static int OPTIONS
          the HTTP OPTIONS type
static int POST
          the HTTP POST type
static int PUT
          the HTTP PUT type
static int TRACE
          the HTTP TRACE type
static int UNSUPPORTED
          the HTTP UNSUPPORTED type
 
Method Summary
 String getFormParameter(String name)
          Gets a form parameter based on the name passed in.
 String[][] getFormParameters()
          Gets all the form parameters in the form of a two-dimentional array The second dimention has two indexes which contain the key and value for example: for(int i=0; i All values are strings
 String getHeader(String name)
          Gets a header based the header name passed in.
 int getMethod()
          Gets an integer value of the request method.
 String getQueryParameter(String name)
          Gets a URL (or query) parameter based on the name passed in.
 HttpSession getSession()
          Returns the current session associated with this request, or if the request does not have a session, creates one.
 HttpSession getSession(boolean create)
          Returns the current HttpSession associated with this request or, if there is no current session and create is true, returns a new session.
 URL getURI()
          Gets the URI for the current URL page.
 

Field Detail

OPTIONS

public static final int OPTIONS
the HTTP OPTIONS type

See Also:
Constant Field Values

GET

public static final int GET
the HTTP GET type

See Also:
Constant Field Values

HEAD

public static final int HEAD
the HTTP HEAD type

See Also:
Constant Field Values

POST

public static final int POST
the HTTP POST type

See Also:
Constant Field Values

PUT

public static final int PUT
the HTTP PUT type

See Also:
Constant Field Values

DELETE

public static final int DELETE
the HTTP DELETE type

See Also:
Constant Field Values

TRACE

public static final int TRACE
the HTTP TRACE type

See Also:
Constant Field Values

CONNECT

public static final int CONNECT
the HTTP CONNECT type

See Also:
Constant Field Values

UNSUPPORTED

public static final int UNSUPPORTED
the HTTP UNSUPPORTED type

See Also:
Constant Field Values

HEADER_ACCEPT

public static final String HEADER_ACCEPT
the Accept header

See Also:
Constant Field Values

HEADER_ACCEPT_ENCODING

public static final String HEADER_ACCEPT_ENCODING
the Accept-Encoding header

See Also:
Constant Field Values

HEADER_ACCEPT_LANGUAGE

public static final String HEADER_ACCEPT_LANGUAGE
the Accept-Language header

See Also:
Constant Field Values

HEADER_CONTENT_TYPE

public static final String HEADER_CONTENT_TYPE
the Content-Type header

See Also:
Constant Field Values

HEADER_CONTENT_LENGTH

public static final String HEADER_CONTENT_LENGTH
the Content-Length header

See Also:
Constant Field Values

HEADER_CONNECTION

public static final String HEADER_CONNECTION
the Connection header

See Also:
Constant Field Values

HEADER_CACHE_CONTROL

public static final String HEADER_CACHE_CONTROL
the Cache-Control header

See Also:
Constant Field Values

HEADER_HOST

public static final String HEADER_HOST
the Host header

See Also:
Constant Field Values

HEADER_USER_AGENT

public static final String HEADER_USER_AGENT
the User-Agent header

See Also:
Constant Field Values

HEADER_SET_COOKIE

public static final String HEADER_SET_COOKIE
the Set-Cookie header

See Also:
Constant Field Values

HEADER_COOKIE

public static final String HEADER_COOKIE
the Cookie header

See Also:
Constant Field Values
Method Detail

getSession

public HttpSession getSession(boolean create)
Returns the current HttpSession associated with this request or, if there is no current session and create is true, returns a new session.

If create is false and the request has no valid HttpSession, this method returns null.

Parameters:
create - true to create a new session for this request if necessary; false to return null if there's no current session
Returns:
the HttpSession associated with this request or null if create is false and the request has no valid session
See Also:
getSession()

getSession

public HttpSession getSession()
Returns the current session associated with this request, or if the request does not have a session, creates one.

Returns:
the HttpSession associated with this request
See Also:
getSession(boolean)

getHeader

public String getHeader(String name)
Gets a header based the header name passed in.

Parameters:
name - The name of the header to get
Returns:
The value of the header

getFormParameter

public String getFormParameter(String name)
Gets a form parameter based on the name passed in.

Parameters:
name - The name of the form parameter to get
Returns:
The value of the parameter

getFormParameters

public String[][] getFormParameters()
Gets all the form parameters in the form of a two-dimentional array The second dimention has two indexes which contain the key and value for example: for(int i=0; i All values are strings

Returns:
All the form parameters

getQueryParameter

public String getQueryParameter(String name)
Gets a URL (or query) parameter based on the name passed in.

Parameters:
name - The name of the URL (or query) parameter
Returns:
The value of the URL (or query) parameter

getMethod

public int getMethod()
Gets an integer value of the request method. These values are: OPTIONS = 0 GET = 1 HEAD = 2 POST = 3 PUT = 4 DELETE = 5 TRACE = 6 CONNECT = 7 UNSUPPORTED = 8

Returns:
The integer value of the method

getURI

public URL getURI()
Gets the URI for the current URL page.

Returns:
The URI


Copyright © 1999-2005 OpenEJB. All Rights Reserved.