org.jboss.portal.web
Interface WebRequest

All Superinterfaces:
javax.servlet.http.HttpServletRequest, javax.servlet.ServletRequest
All Known Implementing Classes:
AbstractWebRequest, EndPointRequest

public interface WebRequest
extends javax.servlet.http.HttpServletRequest

Extends the HttpServletRequest interface to add web module concepts.

Version:
$Revision: 1.1 $
Author:
Julien Viet

Nested Class Summary
static class WebRequest.Verb
           
 
Field Summary
static org.jboss.portal.common.net.media.MediaType APPLICATION_X_WWW_FORM_URLENCODED_MEDIA_TYPE
          .
static org.jboss.portal.common.net.media.MediaType MULTIPART_FORM_DATA_MEDIA_TYPE
          .
static java.nio.charset.Charset UTF_8_CHARSET
          .
 
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
 
Method Summary
 Body getBody()
          Returns the body of the request when the request is of type POST otherwise return null.
 java.lang.String getBodyParameter(java.lang.String parameterName)
          Returns a parameter value from the body or null if it cannot be found.
 java.lang.String[] getBodyParameterValues(java.lang.String parameterName)
          Returns a parameter values from the body or null if it cannot be found.
 org.jboss.portal.common.net.media.MediaType getMediaType()
          Returns the media type or null if none was provided.
 java.lang.String getQueryParameter(java.lang.String parameterName)
          Returns a parameter value from the query string or null if it cannot be found.
 java.util.Map<java.lang.String,java.lang.String[]> getQueryParameterMap()
          Returns the query parameter map.
 java.lang.String[] getQueryParameterValues(java.lang.String parameterName)
          Returns a parameter values from the query string or null if it cannot be found.
 WebRequest.Verb getVerb()
          Returns the an enum instead of a string as returned by HttpServletRequest.getMethod() which is more convenient to use sometimes.
 java.lang.String getWebContextPath()
          Returns the web context path.
 java.lang.String getWebRequestPath()
          Returns the web request path which is a consistent value and does not depend on the kind of mapping of the underlying servlet.
 
Methods inherited from interface javax.servlet.http.HttpServletRequest
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole
 
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, isSecure, removeAttribute, setAttribute, setCharacterEncoding
 

Field Detail

APPLICATION_X_WWW_FORM_URLENCODED_MEDIA_TYPE

static final org.jboss.portal.common.net.media.MediaType APPLICATION_X_WWW_FORM_URLENCODED_MEDIA_TYPE
.


MULTIPART_FORM_DATA_MEDIA_TYPE

static final org.jboss.portal.common.net.media.MediaType MULTIPART_FORM_DATA_MEDIA_TYPE
.


UTF_8_CHARSET

static final java.nio.charset.Charset UTF_8_CHARSET
.

Method Detail

getVerb

WebRequest.Verb getVerb()
Returns the an enum instead of a string as returned by HttpServletRequest.getMethod() which is more convenient to use sometimes.

Returns:
the verb

getQueryParameterMap

java.util.Map<java.lang.String,java.lang.String[]> getQueryParameterMap()
Returns the query parameter map. If no query string was provided it returns an empty map in order to avoid to return a null object.

Returns:
the query parameter map

getQueryParameter

java.lang.String getQueryParameter(java.lang.String parameterName)
Returns a parameter value from the query string or null if it cannot be found.

Parameters:
parameterName - the parameter name
Returns:
the parameter value

getQueryParameterValues

java.lang.String[] getQueryParameterValues(java.lang.String parameterName)
Returns a parameter values from the query string or null if it cannot be found.

Parameters:
parameterName - the parameter name
Returns:
the parameter value

getBodyParameter

java.lang.String getBodyParameter(java.lang.String parameterName)
Returns a parameter value from the body or null if it cannot be found. If the content type of the request is not application/x-www-form-urlencoded then this method will always return null.

Parameters:
parameterName - the parameter name
Returns:
the parameter value

getBodyParameterValues

java.lang.String[] getBodyParameterValues(java.lang.String parameterName)
Returns a parameter values from the body or null if it cannot be found. If the content type of the request is not application/x-www-form-urlencoded then this method will always return null.

Parameters:
parameterName - the parameter name
Returns:
the parameter value

getBody

Body getBody()
Returns the body of the request when the request is of type POST otherwise return null.

Returns:
the body

getMediaType

org.jboss.portal.common.net.media.MediaType getMediaType()
Returns the media type or null if none was provided.

Returns:
the media type

getWebRequestPath

java.lang.String getWebRequestPath()
Returns the web request path which is a consistent value and does not depend on the kind of mapping of the underlying servlet. It is never null and always start with a '/' char.

Returns:
the web request path

getWebContextPath

java.lang.String getWebContextPath()
Returns the web context path. The web context path value is computed such as the value returned by the method HttpServletRequest.getRequestURI() is a prefix of the concatenation of the web context path and the web request path.

Returns:
the web context path


Copyright © 2008. All Rights Reserved.