Class ResponseWrapper
java.lang.Object
spark.Response
spark.http.matching.ResponseWrapper
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbody()returns the bodyvoidSets the bodyvoidAdds not persistent cookie to the response.voidAdds cookie to the response.voidAdds cookie to the response.voidAdds cookie to the response.voidAdds cookie to the response.voidcookie(String domain, String path, String name, String value, int maxAge, boolean secured, boolean httpOnly) Adds cookie to the response.(package private) static ResponseWrappercreate()boolean(package private) ResponseinthashCode()voidAdds/Sets a response header(package private) booleanjavax.servlet.http.HttpServletResponseraw()voidTrigger a browser redirectvoidTrigger a browser redirect with specific http 3XX status code.voidremoveCookie(String name) Removes the cookie.voidremoveCookie(String path, String name) Removes the cookie with given path and name.voidsetDelegate(Response delegate) intstatus()Returns the status codevoidstatus(int statusCode) Sets the status code for thetoString()type()Returns the content typevoidSets the content type for the response
-
Field Details
-
delegate
-
redirected
private boolean redirected
-
-
Constructor Details
-
ResponseWrapper
private ResponseWrapper()
-
-
Method Details
-
create
-
setDelegate
-
getDelegate
Response getDelegate() -
status
-
status
-
body
-
body
-
equals
-
hashCode
-
raw
-
redirect
-
redirect
-
isRedirected
boolean isRedirected()- Returns:
- true if redirected has been done
-
header
-
toString
-
type
-
type
-
cookie
-
cookie
Description copied from class:ResponseAdds cookie to the response. Can be invoked multiple times to insert more than one cookie. -
cookie
Description copied from class:ResponseAdds cookie to the response. Can be invoked multiple times to insert more than one cookie. -
cookie
Description copied from class:ResponseAdds cookie to the response. Can be invoked multiple times to insert more than one cookie. -
cookie
public void cookie(String path, String name, String value, int maxAge, boolean secured, boolean httpOnly) Description copied from class:ResponseAdds cookie to the response. Can be invoked multiple times to insert more than one cookie.- Overrides:
cookiein classResponse- Parameters:
path- path of the cookiename- name of the cookievalue- value of the cookiemaxAge- max age of the cookie in seconds (negative for the not persistent cookie, zero - deletes the cookie)secured- if true : cookie will be securedhttpOnly- if true: cookie will be marked as http only
-
cookie
public void cookie(String domain, String path, String name, String value, int maxAge, boolean secured, boolean httpOnly) Description copied from class:ResponseAdds cookie to the response. Can be invoked multiple times to insert more than one cookie.- Overrides:
cookiein classResponse- Parameters:
domain- domain of the cookiepath- path of the cookiename- name of the cookievalue- value of the cookiemaxAge- max age of the cookie in seconds (negative for the not persistent cookie, zero - deletes the cookie)secured- if true : cookie will be securedhttpOnly- if true: cookie will be marked as http only
-
removeCookie
Description copied from class:ResponseRemoves the cookie.- Overrides:
removeCookiein classResponse- Parameters:
name- name of the cookie
-
removeCookie
Description copied from class:ResponseRemoves the cookie with given path and name.- Overrides:
removeCookiein classResponse- Parameters:
path- path of the cookiename- name of the cookie
-