Package org.apache.struts2.rest
Class DefaultHttpHeaders
java.lang.Object
org.apache.struts2.rest.DefaultHttpHeaders
- All Implemented Interfaces:
HttpHeaders
Default implementation of rest info that uses fluent-style construction
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object target) Applies the configured information to the responseintlastModified(Date date) renderResult(String code) setLocation(String loc) setLocationId(Object id) voidsetStatus(int s) withStatus(int code)
-
Constructor Details
-
DefaultHttpHeaders
public DefaultHttpHeaders() -
DefaultHttpHeaders
-
-
Method Details
-
renderResult
-
withStatus
-
withETag
-
withNoETag
-
setLocationId
-
setLocation
-
lastModified
-
disableCaching
-
apply
public String apply(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object target) Description copied from interface:HttpHeadersApplies the configured information to the response- Specified by:
applyin interfaceHttpHeaders- Parameters:
request- The requestresponse- The responsetarget- The target object, usually the action- Returns:
- The result code to process
-
getStatus
public int getStatus()- Specified by:
getStatusin interfaceHttpHeaders- Returns:
- The HTTP status code
-
setStatus
public void setStatus(int s) - Specified by:
setStatusin interfaceHttpHeaders- Parameters:
s- set the HTTP status code
-
getResultCode
- Specified by:
getResultCodein interfaceHttpHeaders- Returns:
- The result code to process
-