Class WebScriptServletRequest
- java.lang.Object
-
- org.springframework.extensions.webscripts.WebScriptRequestImpl
-
- org.springframework.extensions.webscripts.servlet.WebScriptServletRequest
-
- All Implemented Interfaces:
WebScriptRequest
public class WebScriptServletRequest extends WebScriptRequestImpl
HTTP Servlet Web Script Request- Author:
- davidc
-
-
Field Summary
-
Fields inherited from class org.springframework.extensions.webscripts.WebScriptRequestImpl
MULTIPART_FORM_DATA
-
-
Constructor Summary
Constructors Constructor Description WebScriptServletRequest(Runtime container, javax.servlet.http.HttpServletRequest req, Match serviceMatch, ServerProperties serverProperties)Construction
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanforceSuccessStatus()Force response to return SUCCESS (200) code Note: This is to support clients who cannot support non-success codes e.g.java.lang.StringgetAgent()Get User Agent TODO: Expand on known agentsorg.springframework.extensions.surf.util.ContentgetContent()Gets the request body as contentjava.lang.StringgetContentType()Gets the mimetype of the requestjava.lang.StringgetContextPath()Gets the Alfresco Context PathFormData.FormFieldgetFileField(java.lang.String name)Returns the FormField bject representing a file uploaded via a multipart form.java.lang.StringgetHeader(java.lang.String name)Gets the value of the named headerjava.lang.String[]getHeaderNames()Gets the names of all headers for this requestjava.lang.String[]getHeaderValues(java.lang.String name)Gets the (array) value of the named header Note: An array of one item is returned when a "single value" named header is requestedjavax.servlet.http.HttpServletRequestgetHttpServletRequest()Gets the HTTP Servlet Requestjava.lang.StringgetParameter(java.lang.String name)Gets the value of the named parameterjava.lang.String[]getParameterNames()Gets the names of all parameters on the Urljava.lang.String[]getParameterValues(java.lang.String name)Gets the (array) value of the named parameter Note: An array of one item is returned when a "single value" named parameter is requestedjava.lang.StringgetPathInfo()Gets the service specific pathjava.lang.StringgetQueryString()Gets the query Stringjava.lang.StringgetServerPath()Get server portion of the request e.g.java.lang.StringgetServiceContextPath()Gets the Alfresco Web Script Context PathMatchgetServiceMatch()Gets the matching API Service for this requestjava.lang.StringgetServicePath()Gets the Alfresco Service Pathjava.lang.StringgetURL()Gets the full request URLstatic java.lang.StringresolveUserAgent(java.lang.String userAgent)Helper to resolve common user agent strings from Http request headerjava.lang.StringtoString()-
Methods inherited from class org.springframework.extensions.webscripts.WebScriptRequestImpl
getExtensionPath, getFormat, getFormatStyle, getJSONCallback, getRuntime, isGuest, parseContent
-
-
-
-
Constructor Detail
-
WebScriptServletRequest
public WebScriptServletRequest(Runtime container, javax.servlet.http.HttpServletRequest req, Match serviceMatch, ServerProperties serverProperties)
Construction- Parameters:
container- request generatorreq- HttpServletRequestserviceMatch- MatchserverProperties- ServerProperties
-
-
Method Detail
-
getHttpServletRequest
public javax.servlet.http.HttpServletRequest getHttpServletRequest()
Gets the HTTP Servlet Request- Returns:
- HTTP Servlet Request
-
getServiceMatch
public Match getServiceMatch()
Description copied from interface:WebScriptRequestGets the matching API Service for this request- Returns:
- the service match
-
getServerPath
public java.lang.String getServerPath()
Description copied from interface:WebScriptRequestGet server portion of the request e.g. scheme://host:port- Returns:
- server path
-
getContextPath
public java.lang.String getContextPath()
Description copied from interface:WebScriptRequestGets the Alfresco Context Path- Returns:
- context url e.g. /alfresco
-
getServiceContextPath
public java.lang.String getServiceContextPath()
Description copied from interface:WebScriptRequestGets the Alfresco Web Script Context Path- Returns:
- service url e.g. /alfresco/service
-
getServicePath
public java.lang.String getServicePath()
Description copied from interface:WebScriptRequestGets the Alfresco Service Path- Returns:
- service url e.g. /alfresco/service/search/keyword
-
getURL
public java.lang.String getURL()
Description copied from interface:WebScriptRequestGets the full request URL- Returns:
- request url e.g. /alfresco/service/search/keyword?q=term
-
getPathInfo
public java.lang.String getPathInfo()
Description copied from interface:WebScriptRequestGets the service specific path- Returns:
- request path e.g. /search/keyword
-
getQueryString
public java.lang.String getQueryString()
Description copied from interface:WebScriptRequestGets the query String- Returns:
- query string e.g. q=alfresco&format=atom
-
getParameterNames
public java.lang.String[] getParameterNames()
Description copied from interface:WebScriptRequestGets the names of all parameters on the Url- Returns:
- the names (empty, if none)
-
getParameter
public java.lang.String getParameter(java.lang.String name)
Description copied from interface:WebScriptRequestGets the value of the named parameter- Parameters:
name- parameter name- Returns:
- parameter value (or null, if parameter does not exist)
-
getParameterValues
public java.lang.String[] getParameterValues(java.lang.String name)
Description copied from interface:WebScriptRequestGets the (array) value of the named parameter Note: An array of one item is returned when a "single value" named parameter is requested- Parameters:
name- parameter name- Returns:
- array of values (or null, if parameter does not exist)
-
getHeaderNames
public java.lang.String[] getHeaderNames()
Description copied from interface:WebScriptRequestGets the names of all headers for this request- Returns:
- the names (empty, if none)
-
getHeader
public java.lang.String getHeader(java.lang.String name)
Description copied from interface:WebScriptRequestGets the value of the named header- Parameters:
name- header name- Returns:
- header value (or null, if header does not exist)
-
getHeaderValues
public java.lang.String[] getHeaderValues(java.lang.String name)
Description copied from interface:WebScriptRequestGets the (array) value of the named header Note: An array of one item is returned when a "single value" named header is requested- Parameters:
name- header name- Returns:
- array of values (or null, if header does not exist)
-
getAgent
public java.lang.String getAgent()
Description copied from interface:WebScriptRequestGet User Agent TODO: Expand on known agents- Returns:
- MSIE / Firefox
-
resolveUserAgent
public static java.lang.String resolveUserAgent(java.lang.String userAgent)
Helper to resolve common user agent strings from Http request header
-
getContent
public org.springframework.extensions.surf.util.Content getContent()
Description copied from interface:WebScriptRequestGets the request body as content- Returns:
- request content (or null, if none)
-
getContentType
public java.lang.String getContentType()
Description copied from interface:WebScriptRequestGets the mimetype of the request- Specified by:
getContentTypein interfaceWebScriptRequest- Overrides:
getContentTypein classWebScriptRequestImpl- Returns:
- request content mimetype
-
getFileField
public FormData.FormField getFileField(java.lang.String name)
Returns the FormField bject representing a file uploaded via a multipart form.- Parameters:
name- The name of the field containing the content- Returns:
- FormField bject representing a file uploaded via a multipart form or null if the field does not exist or is not a file field.
-
forceSuccessStatus
public boolean forceSuccessStatus()
Description copied from interface:WebScriptRequestForce response to return SUCCESS (200) code Note: This is to support clients who cannot support non-success codes e.g. Flash player- Specified by:
forceSuccessStatusin interfaceWebScriptRequest- Overrides:
forceSuccessStatusin classWebScriptRequestImpl- Returns:
- true => force return of 200, otherwise return status explicitly set
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-