wicket.protocol.http.servlet
Class ServletWebRequest

java.lang.Object
  extended by wicket.Request
      extended by wicket.protocol.http.WebRequest
          extended by wicket.protocol.http.servlet.ServletWebRequest
Direct Known Subclasses:
MultipartServletWebRequest, WebRequestWithCryptedUrl

public class ServletWebRequest
extends WebRequest

A Servlet specific WebRequest implementation wrapping a HttpServletRequest

Author:
Ate Douma

Constructor Summary
ServletWebRequest(javax.servlet.http.HttpServletRequest httpServletRequest)
          Protected constructor.
 
Method Summary
 java.lang.String getContextPath()
          Gets the servlet context path.
 javax.servlet.http.HttpServletRequest getHttpServletRequest()
          Gets the wrapped http servlet request object.
 java.util.Locale getLocale()
          Returns the preferred Locale that the client will accept content in, based on the Accept-Language header.
 java.lang.String getParameter(java.lang.String key)
          Gets the request parameter with the given key.
 java.util.Map getParameterMap()
          Gets the request parameters.
 java.lang.String[] getParameters(java.lang.String key)
          Gets the request parameters with the given key.
 java.lang.String getPath()
          Gets the path info if any.
 java.lang.String getRelativeURL()
          Gets the relative url (url without the context path and without a leading '/').
 java.lang.String getServletPath()
          Gets the servlet path.
 boolean isAjax()
          Is the request an ajax request?
 WebRequest newMultipartWebRequest(Bytes maxsize)
          Create a runtime context type specific (e.g.
 java.lang.String toString()
           
 
Methods inherited from class wicket.protocol.http.WebRequest
getCookies, getURL
 
Methods inherited from class wicket.Request
decodeURL, getPage, getRequestParameters, setPage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServletWebRequest

public ServletWebRequest(javax.servlet.http.HttpServletRequest httpServletRequest)
Protected constructor.

Parameters:
httpServletRequest - The servlet request information
Method Detail

getContextPath

public java.lang.String getContextPath()
Gets the servlet context path.

Specified by:
getContextPath in class WebRequest
Returns:
Servlet context path

getHttpServletRequest

public final javax.servlet.http.HttpServletRequest getHttpServletRequest()
Gets the wrapped http servlet request object.

Specified by:
getHttpServletRequest in class WebRequest
Returns:
the wrapped http serlvet request object.

getLocale

public java.util.Locale getLocale()
Returns the preferred Locale that the client will accept content in, based on the Accept-Language header. If the client request doesn't provide an Accept-Language header, this method returns the default locale for the server.

Specified by:
getLocale in class WebRequest
Returns:
the preferred Locale for the client

getParameter

public java.lang.String getParameter(java.lang.String key)
Gets the request parameter with the given key.

Specified by:
getParameter in class WebRequest
Parameters:
key - Parameter name
Returns:
Parameter value

getParameterMap

public java.util.Map getParameterMap()
Gets the request parameters.

Specified by:
getParameterMap in class WebRequest
Returns:
Map of parameters

getParameters

public java.lang.String[] getParameters(java.lang.String key)
Gets the request parameters with the given key.

Specified by:
getParameters in class WebRequest
Parameters:
key - Parameter name
Returns:
Parameter values

getPath

public java.lang.String getPath()
Gets the path info if any.

Specified by:
getPath in class Request
Returns:
Any servlet path info

getRelativeURL

public java.lang.String getRelativeURL()
Gets the relative url (url without the context path and without a leading '/'). Use this method to load resources using the servlet context.

Specified by:
getRelativeURL in class Request
Returns:
Request URL

getServletPath

public java.lang.String getServletPath()
Gets the servlet path.

Specified by:
getServletPath in class WebRequest
Returns:
Servlet path

isAjax

public boolean isAjax()
Description copied from class: WebRequest
Is the request an ajax request?

Specified by:
isAjax in class WebRequest
Returns:
True if the ajax is an ajax request. False if it's not.

newMultipartWebRequest

public WebRequest newMultipartWebRequest(Bytes maxsize)
Description copied from class: WebRequest
Create a runtime context type specific (e.g. Servlet or Portlet) MultipartWebRequest wrapper for handling multipart content uploads.

Specified by:
newMultipartWebRequest in class WebRequest
Parameters:
maxsize - the maximum size this request may be
Returns:
new WebRequest wrapper implementing MultipartWebRequest
See Also:
WebRequest.newMultipartWebRequest(wicket.util.lang.Bytes)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2004-2007 Wicket developers. All Rights Reserved.