Package io.jans.context
Interface WebContext
- All Known Implementing Classes:
J2EContext
public interface WebContext
This is interface for J2E context wrapper
- Author:
- Yuriy Movchan 11/14/2014
-
Method Summary
Modifier and TypeMethodDescriptionReturn the full URL (with query string) the client used to request the servergetRequestAttribute(String name) Get an attribute from requestgetRequestHeader(String name) Return a request headerReturn the request methodgetRequestParameter(String name) Return a request parameterReturn all request parametersReturn the schemeReturn the server nameintReturn the server portjakarta.servlet.http.HttpSessiongetSession(boolean create) getSessionAttribute(String name) Get an attribute from sessionvoidsendRedirect(String location) voidsetRequestAttribute(String name, Object value) Save an attribute in requestvoidsetResponseHeader(String name, String value) Add a header to the responsevoidsetSessionAttribute(String name, Object value) Save an attribute in sessionvoidwriteResponseContent(String content) Write some content in the response
-
Method Details
-
getRequestParameter
Return a request parameter- Parameters:
name-- Returns:
- the request parameter
-
getRequestParameters
Return all request parameters- Returns:
- all request parameters
-
getRequestHeader
Return a request header- Parameters:
name-- Returns:
- the request header
-
setSessionAttribute
Save an attribute in session- Parameters:
name-value-
-
getSessionAttribute
Get an attribute from session- Parameters:
name-- Returns:
- the session attribute
-
setRequestAttribute
Save an attribute in request- Parameters:
name-value-
-
getRequestAttribute
Get an attribute from request- Parameters:
name-- Returns:
- the request attribute
-
getRequestMethod
String getRequestMethod()Return the request method- Returns:
- the request method
-
writeResponseContent
Write some content in the response- Parameters:
content-- Throws:
IOException
-
setResponseHeader
Add a header to the response- Parameters:
name-value-
-
getServerName
String getServerName()Return the server name- Returns:
- the server name
-
getServerPort
int getServerPort()Return the server port- Returns:
- the server port
-
getScheme
String getScheme()Return the scheme- Returns:
- the scheme
-
getFullRequestURL
String getFullRequestURL()Return the full URL (with query string) the client used to request the server- Returns:
- the Url
-
sendRedirect
- Throws:
IOException
-
getSession
jakarta.servlet.http.HttpSession getSession(boolean create)
-