public class HttpServerRequestResponse extends Object implements IRequestResponse
| Modifier and Type | Method and Description |
|---|---|
void |
addCookie(javax.servlet.http.Cookie cookie) |
void |
addHeader(String name,
String value) |
static HttpServerRequestResponse |
create(DomApplication application,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
static HttpServerRequestResponse |
get(IRequestContext ctx) |
String |
getApplicationURL()
Return the base URL to the web application from the current requests.
|
javax.servlet.http.Cookie[] |
getCookies() |
UploadItem[] |
getFileParameter(String name) |
String[] |
getFileParameters()
Returns the names of all file parameters.
|
String |
getHostURL() |
OutputStream |
getOutputStream(String contentType,
String encoding,
int contentLength) |
Writer |
getOutputWriter(String contentType,
String encoding) |
String |
getParameter(String name) |
String[] |
getParameterNames() |
String[] |
getParameters(String name) |
String |
getQueryString() |
String |
getRemoteUser()
The "remote" user ID from a server request, if present.
|
javax.servlet.http.HttpServletRequest |
getRequest() |
String |
getRequestURI()
Must return the path part of a request URL.
|
javax.servlet.http.HttpServletResponse |
getResponse() |
IServerSession |
getServerSession(boolean create)
Returns a wrapper for a
HttpSession. |
String |
getUserAgent() |
String |
getWebappContext()
Returns the webapp context as either an empty string for the ROOT context or a string starting without a slash and always ending
in one, like "viewpoint/".
|
void |
redirect(String newUrl)
Send a redirect response to the client.
|
void |
releaseUploads()
Called when uploaded files are no longer needed; this can then discard of them.
|
void |
sendError(int httpErrorCode,
String message)
Send an error back to the client.
|
void |
setExpiry(int cacheTime) |
void |
setNoCache() |
@Nonnull public String getRequestURI()
IRequestResponsegetRequestURI in interface IRequestResponse@Nonnull public String getQueryString()
getQueryString in interface IRequestResponse@Nonnull public javax.servlet.http.HttpServletRequest getRequest()
@Nonnull public javax.servlet.http.HttpServletResponse getResponse()
@Nonnull public String getWebappContext()
IRequestResponsegetWebappContext in interface IRequestResponse@Nonnull public static HttpServerRequestResponse create(@Nonnull DomApplication application, @Nonnull javax.servlet.http.HttpServletRequest request, @Nonnull javax.servlet.http.HttpServletResponse response)
public void releaseUploads()
IRequestResponsereleaseUploads in interface IRequestResponse@Nonnull public String getUserAgent()
getUserAgent in interface IRequestResponse@Nonnull public String getApplicationURL()
IRequestResponsegetApplicationURL in interface IRequestResponse@Nonnull public String getHostURL()
getHostURL in interface IRequestResponse@Nullable public String getParameter(@Nonnull String name)
getParameter in interface IRequestResponseIParameterInfo.getParameter(java.lang.String)@Nonnull public String[] getParameters(@Nonnull String name)
getParameters in interface IRequestResponseIParameterInfo.getParameters(java.lang.String)@Nonnull public String[] getParameterNames()
getParameterNames in interface IRequestResponseIParameterInfo.getParameterNames()@Nonnull public String[] getFileParameters() throws Exception
getFileParameters in interface IRequestResponseException@Nonnull public UploadItem[] getFileParameter(@Nonnull String name) throws Exception
getFileParameter in interface IRequestResponseExceptionpublic void setNoCache()
setNoCache in interface IRequestResponsepublic void setExpiry(int cacheTime)
setExpiry in interface IRequestResponse@Nonnull public Writer getOutputWriter(@Nonnull String contentType, @Nullable String encoding) throws IOException
getOutputWriter in interface IRequestResponseIOException@Nonnull public OutputStream getOutputStream(@Nonnull String contentType, @Nullable String encoding, int contentLength) throws Exception
getOutputStream in interface IRequestResponseExceptionpublic void redirect(@Nonnull String newUrl) throws Exception
redirect in interface IRequestResponsenewUrl - Exceptionpublic void sendError(int httpErrorCode,
@Nonnull
String message)
throws Exception
IRequestResponsesendError in interface IRequestResponseExceptionpublic void addHeader(@Nonnull String name, @Nonnull String value)
addHeader in interface IRequestResponsepublic void addCookie(@Nonnull javax.servlet.http.Cookie cookie)
addCookie in interface IRequestResponse@Nonnull public javax.servlet.http.Cookie[] getCookies()
getCookies in interface IRequestResponse@Nullable public String getRemoteUser()
IRequestResponsegetRemoteUser in interface IRequestResponse@Nullable public IServerSession getServerSession(boolean create)
IRequestResponseHttpSession. If "create" is true the session will be
created if it does not exist in which case the call will never return null.getServerSession in interface IRequestResponse@Nullable public static HttpServerRequestResponse get(@Nonnull IRequestContext ctx)
Copyright © 2017 etc.to. All rights reserved.