Class ServletWebRequest

    • Constructor Detail

      • ServletWebRequest

        public ServletWebRequest​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                 String filterPrefix)
        Construct.
        Parameters:
        httpServletRequest -
        filterPrefix - contentPath + filterPath, used to extract the actual Url
      • ServletWebRequest

        public ServletWebRequest​(javax.servlet.http.HttpServletRequest httpServletRequest,
                                 String filterPrefix,
                                 Url url)
        Construct.
        Parameters:
        httpServletRequest -
        filterPrefix - contentPath + filterPath, used to extract the actual Url
        url -
    • Method Detail

      • getClientUrl

        public Url getClientUrl()
        Returns base url without context or filter mapping.

        Example: if current url is

         http://localhost:8080/context/filter/mapping/wicket/bookmarkable/com.foo.Page?1&id=2
         
        the base url is wicket/bookmarkable/com.foo.Page

        Specified by:
        getClientUrl in class Request
        Returns:
        client url
        See Also:
        Request.getClientUrl()
      • getFilterPrefix

        public String getFilterPrefix()
        Returns the prefix of Wicket filter (without the leading /)
        Returns:
        Wicket filter prefix
      • getDateHeader

        public Instant getDateHeader​(String name)
        Description copied from class: WebRequest
        Returns the value of the specified request header as a long value that represents a Date object. Use this method with headers that contain dates, such as If-Modified-Since.
        Specified by:
        getDateHeader in class WebRequest
        Returns:
        date value of request header or null if not found
      • getUrl

        public Url getUrl()
        Description copied from class: Request
        Returns the URL for this request. URL is relative to Wicket filter path.
        Specified by:
        getUrl in class Request
        Returns:
        Url instance
      • newMultipartWebRequest

        public MultipartServletWebRequest newMultipartWebRequest​(Bytes maxSize,
                                                                 String upload)
                                                          throws org.apache.commons.fileupload.FileUploadException
        Creates multipart web request from this request.
        Parameters:
        maxSize - max allowed size of request
        upload - upload identifier for UploadInfo
        Returns:
        multipart request
        Throws:
        org.apache.commons.fileupload.FileUploadException
      • newMultipartWebRequest

        public MultipartServletWebRequest newMultipartWebRequest​(Bytes maxSize,
                                                                 String upload,
                                                                 org.apache.commons.fileupload.FileItemFactory factory)
                                                          throws org.apache.commons.fileupload.FileUploadException
        Creates multipart web request from this request.
        Parameters:
        maxSize - max allowed size of request
        upload - upload identifier for UploadInfo
        factory -
        Returns:
        multipart request
        Throws:
        org.apache.commons.fileupload.FileUploadException
      • getPrefixToContextPath

        public String getPrefixToContextPath()
        Description copied from class: Request
        Returns prefix from Wicket Filter mapping to context path. This method does not take the actual URL into account.

        For example if Wicket filter is mapped to hello/* this method should return ../ regardless of actual URL (after Wicket filter)

        Overrides:
        getPrefixToContextPath in class Request
        Returns:
        prefix to context path for this request.
      • getContainerRequest

        public javax.servlet.http.HttpServletRequest getContainerRequest()
        Description copied from class: Request
        Provides access to the low-level container request object that implementaion of this Request delegate to. This allows users to access features provided by the container requests but not by generalized Wicket Request objects.
        Specified by:
        getContainerRequest in class Request
        Returns:
        low-level container request object, or null if none
      • getContextPath

        public String getContextPath()
        Description copied from class: Request
        Returns the context path or an empty string if the application is running under root context. Returned path, unless an empty string, will always start with a slash and will never end with a slash.
        Overrides:
        getContextPath in class Request
        Returns:
        context path
      • getFilterPath

        public String getFilterPath()
        Description copied from class: Request
        Returns the path to which wicket Filter is mapped or an empty string if the filter is mapped to /*. Returned path, unless an empty string, will always start with a slash and will never end with a slash.
        Overrides:
        getFilterPath in class Request
        Returns:
        filter path
      • shouldPreserveClientUrl

        public boolean shouldPreserveClientUrl()
        Description copied from class: WebRequest
        Signals whether or not request processing should preserve the current client url - in other words, handle this request without redirecting. By default, this method returns false . For example, this method can be used to preserve the url that caused a 404 in the browser if Wicket is also responsible for rendering the 404 page. If this method returns the default value of false then Wicket will redirect to the bookmarkable url of the error page, instead of preserving the url that caused the 404 in the browser.
        Overrides:
        shouldPreserveClientUrl in class WebRequest
        Returns:
        true if current client url should be preserved