Class WebScriptServletRequest
java.lang.Object
org.springframework.extensions.webscripts.WebScriptRequestImpl
org.springframework.extensions.webscripts.servlet.WebScriptServletRequest
- All Implemented Interfaces:
WebScriptRequest
HTTP Servlet Web Script Request
- Author:
- davidc
-
Field Summary
Fields inherited from class org.springframework.extensions.webscripts.WebScriptRequestImpl
MULTIPART_FORM_DATA -
Constructor Summary
ConstructorsConstructorDescriptionWebScriptServletRequest(Runtime container, jakarta.servlet.http.HttpServletRequest req, Match serviceMatch, ServerProperties serverProperties) Construction -
Method Summary
Modifier and TypeMethodDescriptionbooleanForce response to return SUCCESS (200) code Note: This is to support clients who cannot support non-success codes e.g.getAgent()Get User Agent TODO: Expand on known agentsorg.springframework.extensions.surf.util.ContentGets the request body as contentGets the mimetype of the requestGets the Alfresco Context PathgetFileField(String name) Returns the FormField bject representing a file uploaded via a multipart form.Gets the value of the named headerString[]Gets the names of all headers for this requestString[]getHeaderValues(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 requestedjakarta.servlet.http.HttpServletRequestGets the HTTP Servlet RequestgetParameter(String name) Gets the value of the named parameterString[]Gets the names of all parameters on the UrlString[]getParameterValues(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 requestedGets the service specific pathGets the query StringGet server portion of the request e.g.Gets the Alfresco Web Script Context PathGets the matching API Service for this requestGets the Alfresco Service PathgetURL()Gets the full request URLstatic StringresolveUserAgent(String userAgent) Helper to resolve common user agent strings from Http request headertoString()Methods inherited from class org.springframework.extensions.webscripts.WebScriptRequestImpl
getExtensionPath, getFormat, getFormatStyle, getJSONCallback, getRuntime, isGuest, parseContent
-
Constructor Details
-
WebScriptServletRequest
public WebScriptServletRequest(Runtime container, jakarta.servlet.http.HttpServletRequest req, Match serviceMatch, ServerProperties serverProperties) Construction- Parameters:
container- request generatorreq- HttpServletRequestserviceMatch- MatchserverProperties- ServerProperties
-
-
Method Details
-
getHttpServletRequest
public jakarta.servlet.http.HttpServletRequest getHttpServletRequest()Gets the HTTP Servlet Request- Returns:
- HTTP Servlet Request
-
getServiceMatch
Description copied from interface:WebScriptRequestGets the matching API Service for this request- Returns:
- the service match
-
getServerPath
Description copied from interface:WebScriptRequestGet server portion of the request e.g. scheme://host:port- Returns:
- server path
-
getContextPath
Description copied from interface:WebScriptRequestGets the Alfresco Context Path- Returns:
- context url e.g. /alfresco
-
getServiceContextPath
Description copied from interface:WebScriptRequestGets the Alfresco Web Script Context Path- Returns:
- service url e.g. /alfresco/service
-
getServicePath
Description copied from interface:WebScriptRequestGets the Alfresco Service Path- Returns:
- service url e.g. /alfresco/service/search/keyword
-
getURL
Description copied from interface:WebScriptRequestGets the full request URL- Returns:
- request url e.g. /alfresco/service/search/keyword?q=term
-
getPathInfo
Description copied from interface:WebScriptRequestGets the service specific path- Returns:
- request path e.g. /search/keyword
-
getQueryString
Description copied from interface:WebScriptRequestGets the query String- Returns:
- query string e.g. q=alfresco&format=atom
-
getParameterNames
Description copied from interface:WebScriptRequestGets the names of all parameters on the Url- Returns:
- the names (empty, if none)
-
getParameter
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
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
Description copied from interface:WebScriptRequestGets the names of all headers for this request- Returns:
- the names (empty, if none)
-
getHeader
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
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
Description copied from interface:WebScriptRequestGet User Agent TODO: Expand on known agents- Returns:
- MSIE / Firefox
-
resolveUserAgent
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
Description copied from interface:WebScriptRequestGets the mimetype of the request- Specified by:
getContentTypein interfaceWebScriptRequest- Overrides:
getContentTypein classWebScriptRequestImpl- Returns:
- request content mimetype
-
getFileField
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
-