Class WebScriptServletResponse
java.lang.Object
org.springframework.extensions.webscripts.WebScriptResponseImpl
org.springframework.extensions.webscripts.servlet.WebScriptServletResponse
- All Implemented Interfaces:
WebScriptResponse
- Direct Known Subclasses:
WebScriptViewResponse
HTTP Servlet Web Script Response
- Author:
- davidc
-
Field Summary
Fields inherited from interface org.springframework.extensions.webscripts.WebScriptResponse
ATOM_FORMAT, HEADER_LOCATION, HTML_FORMAT, JSON_FORMAT, OPENSEARCH_DESCRIPTION_FORMAT, RSS_FORMAT, XML_FORMAT -
Constructor Summary
ConstructorsConstructorDescriptionWebScriptServletResponse(Runtime container, jakarta.servlet.http.HttpServletResponse res) Construct -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a response header with the given name and value.encodeResourceUrl(String url) Encode a resource URL Note: Some Web Script Runtime environments (e.g.encodeScriptUrl(String url) Encode a script URL Note: Some Web Script Runtime environments (e.g.Return a client side javascript function to build resource urls for this serviceReturn a client side javascript function to build urls to this servicejakarta.servlet.http.HttpServletResponseGets the HTTP Servlet ResponseGets the Output StreamGets the Writervoidreset()Clears response buffer including status and headersvoidClears response including status and headers except the specified headers.voidSets the Cache controlvoidsetContentEncoding(String contentEncoding) Sets the Content EncodingvoidsetContentType(String contentType) Sets the Content TypevoidSet a response header with the given name and value.voidsetStatus(int status) Sets the Response StatusMethods inherited from class org.springframework.extensions.webscripts.WebScriptResponseImpl
getRuntime
-
Constructor Details
-
WebScriptServletResponse
Construct- Parameters:
container- Runtimeres- HttpServletResponse
-
-
Method Details
-
getHttpServletResponse
public jakarta.servlet.http.HttpServletResponse getHttpServletResponse()Gets the HTTP Servlet Response- Returns:
- HTTP Servlet Response
-
setStatus
public void setStatus(int status) Description copied from interface:WebScriptResponseSets the Response Status- Parameters:
status- int
-
setHeader
Description copied from interface:WebScriptResponseSet a response header with the given name and value. If the header has already been set, the new value overwrites the previous one.- Parameters:
name- header namevalue- header value
-
addHeader
Description copied from interface:WebScriptResponseAdds a response header with the given name and value. This method allows a response header to have multiple values.- Parameters:
name- header namevalue- header value
-
setContentType
Description copied from interface:WebScriptResponseSets the Content Type- Parameters:
contentType- String
-
setContentEncoding
Description copied from interface:WebScriptResponseSets the Content Encoding- Parameters:
contentEncoding- String
-
setCache
Description copied from interface:WebScriptResponseSets the Cache control- Parameters:
cache- cache control
-
reset
public void reset()Description copied from interface:WebScriptResponseClears response buffer including status and headers -
reset
Description copied from interface:WebScriptResponseClears response including status and headers except the specified headers. REPO-4388 allow certain headers not to be reset- Parameters:
preserveHeadersPattern- Headers which will not be reset with using a regex pattern.
-
getWriter
Description copied from interface:WebScriptResponseGets the Writer- Returns:
- writer
- Throws:
IOException
-
getOutputStream
Description copied from interface:WebScriptResponseGets the Output Stream- Returns:
- output stream
- Throws:
IOException
-
encodeScriptUrl
Description copied from interface:WebScriptResponseEncode a script URL Note: Some Web Script Runtime environments (e.g. JSR-168, JSF) require urls to be re-written.- Parameters:
url- to encode- Returns:
- encoded url
-
getEncodeScriptUrlFunction
Description copied from interface:WebScriptResponseReturn a client side javascript function to build urls to this service- Parameters:
name- Generated function name- Returns:
- javascript function definition
-
encodeResourceUrl
Description copied from interface:WebScriptResponseEncode a resource URL Note: Some Web Script Runtime environments (e.g. JSR-268, Surf) require urls to be re-written.- Specified by:
encodeResourceUrlin interfaceWebScriptResponse- Overrides:
encodeResourceUrlin classWebScriptResponseImpl- Parameters:
url- to encode- Returns:
- encoded url
-
getEncodeResourceUrlFunction
Description copied from interface:WebScriptResponseReturn a client side javascript function to build resource urls for this service- Specified by:
getEncodeResourceUrlFunctionin interfaceWebScriptResponse- Overrides:
getEncodeResourceUrlFunctionin classWebScriptResponseImpl- Parameters:
name- Generated function name- Returns:
- javascript function definition
-