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
  • Constructor Details

    • WebScriptServletRequest

      public WebScriptServletRequest(Runtime container, jakarta.servlet.http.HttpServletRequest req, Match serviceMatch, ServerProperties serverProperties)
      Construction
      Parameters:
      container - request generator
      req - HttpServletRequest
      serviceMatch - Match
      serverProperties - ServerProperties
  • Method Details

    • getHttpServletRequest

      public jakarta.servlet.http.HttpServletRequest getHttpServletRequest()
      Gets the HTTP Servlet Request
      Returns:
      HTTP Servlet Request
    • getServiceMatch

      public Match getServiceMatch()
      Description copied from interface: WebScriptRequest
      Gets the matching API Service for this request
      Returns:
      the service match
    • getServerPath

      public String getServerPath()
      Description copied from interface: WebScriptRequest
      Get server portion of the request e.g. scheme://host:port
      Returns:
      server path
    • getContextPath

      public String getContextPath()
      Description copied from interface: WebScriptRequest
      Gets the Alfresco Context Path
      Returns:
      context url e.g. /alfresco
    • getServiceContextPath

      public String getServiceContextPath()
      Description copied from interface: WebScriptRequest
      Gets the Alfresco Web Script Context Path
      Returns:
      service url e.g. /alfresco/service
    • getServicePath

      public String getServicePath()
      Description copied from interface: WebScriptRequest
      Gets the Alfresco Service Path
      Returns:
      service url e.g. /alfresco/service/search/keyword
    • getURL

      public String getURL()
      Description copied from interface: WebScriptRequest
      Gets the full request URL
      Returns:
      request url e.g. /alfresco/service/search/keyword?q=term
    • getPathInfo

      public String getPathInfo()
      Description copied from interface: WebScriptRequest
      Gets the service specific path
      Returns:
      request path e.g. /search/keyword
    • getQueryString

      public String getQueryString()
      Description copied from interface: WebScriptRequest
      Gets the query String
      Returns:
      query string e.g. q=alfresco&format=atom
    • getParameterNames

      public String[] getParameterNames()
      Description copied from interface: WebScriptRequest
      Gets the names of all parameters on the Url
      Returns:
      the names (empty, if none)
    • getParameter

      public String getParameter(String name)
      Description copied from interface: WebScriptRequest
      Gets the value of the named parameter
      Parameters:
      name - parameter name
      Returns:
      parameter value (or null, if parameter does not exist)
    • getParameterValues

      public String[] getParameterValues(String name)
      Description copied from interface: WebScriptRequest
      Gets 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 String[] getHeaderNames()
      Description copied from interface: WebScriptRequest
      Gets the names of all headers for this request
      Returns:
      the names (empty, if none)
    • getHeader

      public String getHeader(String name)
      Description copied from interface: WebScriptRequest
      Gets the value of the named header
      Parameters:
      name - header name
      Returns:
      header value (or null, if header does not exist)
    • getHeaderValues

      public String[] getHeaderValues(String name)
      Description copied from interface: WebScriptRequest
      Gets 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 String getAgent()
      Description copied from interface: WebScriptRequest
      Get User Agent TODO: Expand on known agents
      Returns:
      MSIE / Firefox
    • resolveUserAgent

      public static String resolveUserAgent(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: WebScriptRequest
      Gets the request body as content
      Returns:
      request content (or null, if none)
    • getContentType

      public String getContentType()
      Description copied from interface: WebScriptRequest
      Gets the mimetype of the request
      Specified by:
      getContentType in interface WebScriptRequest
      Overrides:
      getContentType in class WebScriptRequestImpl
      Returns:
      request content mimetype
    • getFileField

      public FormData.FormField getFileField(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: WebScriptRequest
      Force response to return SUCCESS (200) code Note: This is to support clients who cannot support non-success codes e.g. Flash player
      Specified by:
      forceSuccessStatus in interface WebScriptRequest
      Overrides:
      forceSuccessStatus in class WebScriptRequestImpl
      Returns:
      true => force return of 200, otherwise return status explicitly set
    • toString

      public String toString()
      Overrides:
      toString in class Object