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 responseint
lastModified
(Date date) renderResult
(String code) setLocation
(String loc) setLocationId
(Object id) void
setStatus
(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:HttpHeaders
Applies the configured information to the response- Specified by:
apply
in 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:
getStatus
in interfaceHttpHeaders
- Returns:
- The HTTP status code
-
setStatus
public void setStatus(int s) - Specified by:
setStatus
in interfaceHttpHeaders
- Parameters:
s
- set the HTTP status code
-
getResultCode
- Specified by:
getResultCode
in interfaceHttpHeaders
- Returns:
- The result code to process
-