Package com.tivoli.am.fim.fedmgr2.page
Class TemplateContextResponse
- java.lang.Object
-
- com.tivoli.am.fim.fedmgr2.page.TemplateContextResponse
-
public class TemplateContextResponse extends java.lang.Object
This class is used as a template context response object. Some request context is also included undertemplateContext.request
This includes:- HTTP Method
- Request path
- Headers
- Request parameters
- The query string
-
-
Constructor Summary
Constructors Constructor Description TemplateContextResponse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
sendRedirect(java.lang.String url)
Set response redirect urlvoid
setHeader(java.lang.String key, java.lang.String value)
Set response headervoid
setStatus(int code)
Set response status codevoid
write(java.lang.String message)
Send content to the output stream
-
-
-
Method Detail
-
write
public void write(java.lang.String message)
Send content to the output streamExample templateContext.response.body.write("Hello") A macro can be retrieved and displayed to the output stream templateContext.macros["@TIMESTAMP@"]
- Parameters:
message
- message to be displayed
-
setHeader
public void setHeader(java.lang.String key, java.lang.String value)
Set response headerExample To set the response header Content-Type templateContext.response.setHeader("Content-Type","application/json")
- Parameters:
key
- header keyvalue
- header value
-
sendRedirect
public void sendRedirect(java.lang.String url)
Set response redirect urlExample To set the response redirect url templateContext.response.sendRedirect("https://www.ibm.com")
- Parameters:
url
- redirect url
-
setStatus
public void setStatus(int code)
Set response status codeExample To set the response status code templateContext.response.setStatus(400)
- Parameters:
code
- status code
-
-