Package org.tinystruct.http.servlet
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.
-
Field Summary
Fields inherited from class org.tinystruct.http.RequestWrapper
request -
Constructor Summary
ConstructorsConstructorDescriptionRequestBuilder(jakarta.servlet.http.HttpServletRequest request) RequestBuilder(jakarta.servlet.http.HttpServletRequest request, boolean secure) -
Method Summary
Modifier and TypeMethodDescriptionbody()org.tinystruct.http.Cookie[]cookies()List<org.tinystruct.data.FileEntity> Return the attachments if there are.Gets the character encoding of the request.getParameter(String name) org.tinystruct.http.Sessionorg.tinystruct.http.SessiongetSession(String id) org.tinystruct.http.SessiongetSession(String id, boolean generated) org.tinystruct.http.Headersheaders()booleanisSecure()org.tinystruct.http.Methodmethod()String[]query()org.tinystruct.http.Request<jakarta.servlet.http.HttpServletRequest, jakarta.servlet.ServletInputStream> setMethod(org.tinystruct.http.Method method) org.tinystruct.http.Request<jakarta.servlet.http.HttpServletRequest, jakarta.servlet.ServletInputStream> voidsetVersion(org.tinystruct.http.Version version) jakarta.servlet.ServletInputStreamstream()uri()org.tinystruct.http.Versionversion()
-
Constructor Details
-
RequestBuilder
public RequestBuilder(jakarta.servlet.http.HttpServletRequest request, boolean secure) -
RequestBuilder
public RequestBuilder(jakarta.servlet.http.HttpServletRequest request)
-
-
Method Details
-
getSession
-
getSession
-
getSession
public org.tinystruct.http.Session getSession() -
query
-
body
- Returns:
- body string.
-
isSecure
public boolean isSecure() -
stream
public jakarta.servlet.ServletInputStream stream() -
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
-
setUri
public org.tinystruct.http.Request<jakarta.servlet.http.HttpServletRequest,jakarta.servlet.ServletInputStream> setUri(String uri) -
getParameter
-
getAttachments
public List<org.tinystruct.data.FileEntity> getAttachments() throws org.tinystruct.ApplicationExceptionReturn the attachments if there are.- Returns:
- list of
FileEntity - Throws:
org.tinystruct.ApplicationException
-
getCharacterEncoding
Gets the character encoding of the request.- Returns:
- the character encoding of the request
-
cookies
public org.tinystruct.http.Cookie[] cookies()
-