Package spark.http.matching
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
public void status(int statusCode) Description copied from class:ResponseSets the status code for the -
status
public int status()Description copied from class:ResponseReturns the status code -
body
Description copied from class:ResponseSets the body -
body
Description copied from class:Responsereturns the body -
equals
-
hashCode
public int hashCode() -
raw
public javax.servlet.http.HttpServletResponse raw() -
redirect
Description copied from class:ResponseTrigger a browser redirect -
redirect
Description copied from class:ResponseTrigger a browser redirect with specific http 3XX status code. -
isRedirected
boolean isRedirected()- Returns:
- true if redirected has been done
-
header
Description copied from class:ResponseAdds/Sets a response header -
toString
-
type
Description copied from class:ResponseSets the content type for the response -
type
Description copied from class:ResponseReturns the content type -
cookie
Description copied from class:ResponseAdds not persistent 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
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
-