Package org.ujorm.tools.web.request
Class HttpContextImpl
java.lang.Object
org.ujorm.tools.web.request.HttpContextImpl
- All Implemented Interfaces:
HttpContext
A default implementation of the HTTP servlet request context
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpContextImpl(URequest uRequest) HttpContextImpl(URequest uRequest, Appendable writer) -
Method Summary
Modifier and TypeMethodDescriptiongetParameter(@NotNull String key) Returns the last parameter or the null value.getParameter(@NotNull String key, String defaultValue) Returns the last parameter<T> TgetParameter(@NotNull String key, T defaultValue, @NotNull Function<String, T> converter) Returns the last parameterReturns the parameter namesstatic HttpContextCreate a default HTTP Contextrequest()An abstract API of the HTTP requestwriter()Returns a writer of the HTTP response
-
Field Details
-
CHARSET
-
-
Constructor Details
-
HttpContextImpl
-
HttpContextImpl
-
HttpContextImpl
public HttpContextImpl()
-
-
Method Details
-
request
An abstract API of the HTTP request- Specified by:
requestin interfaceHttpContext
-
writer
Returns a writer of the HTTP response- Specified by:
writerin interfaceHttpContext
-
getParameter
Returns the last parameter or the null value.- Specified by:
getParameterin interfaceHttpContext
-
getParameterNames
Returns the parameter names- Specified by:
getParameterNamesin interfaceHttpContext
-
getParameter
Returns the last parameter- Specified by:
getParameterin interfaceHttpContext
-
getParameter
public <T> T getParameter(@NotNull @NotNull String key, @NotNull T defaultValue, @NotNull @NotNull Function<String, T> converter) Returns the last parameter- Specified by:
getParameterin interfaceHttpContext
-
ofServlet
public static HttpContext ofServlet(@Nullable @Nullable Object httpServletRequest, @NotNull @NotNull Object httpServletResponse) Create a default HTTP Context
-