Class RequestBuilder

java.lang.Object
org.tinystruct.http.RequestWrapper<jakarta.servlet.http.HttpServletRequest,jakarta.servlet.ServletInputStream>
org.tinystruct.http.servlet.RequestBuilder
All Implemented Interfaces:
org.tinystruct.http.Protocol, org.tinystruct.http.Request<jakarta.servlet.http.HttpServletRequest,jakarta.servlet.ServletInputStream>

public class RequestBuilder extends org.tinystruct.http.RequestWrapper<jakarta.servlet.http.HttpServletRequest,jakarta.servlet.ServletInputStream>
A specialized request builder for Servlet-based HTTP requests. This builder creates Request objects from HttpServletRequest instances, specifically designed for use in servlet containers.

This builder is distinct from the HTTP client request builder and should be used only for handling incoming servlet requests in a web container environment.

  • Constructor Details

    • RequestBuilder

      public RequestBuilder(jakarta.servlet.http.HttpServletRequest request, boolean secure)
    • RequestBuilder

      public RequestBuilder(jakarta.servlet.http.HttpServletRequest request)
  • Method Details

    • getSession

      public org.tinystruct.http.Session getSession(String id)
    • getSession

      public org.tinystruct.http.Session getSession(String id, boolean generated)
    • getSession

      public org.tinystruct.http.Session getSession()
    • query

      public String query()
    • body

      public String body()
      Returns:
      body string.
    • isSecure

      public boolean isSecure()
    • stream

      public jakarta.servlet.ServletInputStream stream()
    • parameterNames

      public String[] parameterNames()
      Returns:
      Parameter Names
    • version

      public org.tinystruct.http.Version version()
    • setVersion

      public void setVersion(org.tinystruct.http.Version version)
    • headers

      public org.tinystruct.http.Headers headers()
    • method

      public org.tinystruct.http.Method method()
    • setMethod

      public org.tinystruct.http.Request<jakarta.servlet.http.HttpServletRequest,jakarta.servlet.ServletInputStream> setMethod(org.tinystruct.http.Method method)
    • uri

      public String uri()
    • setUri

      public org.tinystruct.http.Request<jakarta.servlet.http.HttpServletRequest,jakarta.servlet.ServletInputStream> setUri(String uri)
    • getParameter

      public String getParameter(String name)
    • getAttachments

      public List<org.tinystruct.data.FileEntity> getAttachments() throws org.tinystruct.ApplicationException
      Return the attachments if there are.
      Returns:
      list of FileEntity
      Throws:
      org.tinystruct.ApplicationException
    • getCharacterEncoding

      public String getCharacterEncoding()
      Gets the character encoding of the request.
      Returns:
      the character encoding of the request
    • cookies

      public org.tinystruct.http.Cookie[] cookies()