Before we explain the benefits of creating your own RequestContext please take note that only one instance of this must be created and passed along during a requests life-cycle. In normal circumstances one will be created through the IDACall
servlet and there will be no need for you to handle this explicitly.
A typical use case for explicitly creating a RequestContext is is you've implemented your own standalone servlet which does not extend IDACall
and you require the servlet request/response to be available further down the request chain such as in a DMI call you might issue from your servlet. This could be useful when passing session related data down to your DMI implementations for instance. Once you've created a RequestContext you simply set it on your DSRequest
or RPCRequest
using setContext(requestContext)
.
servletContext
- the servlet context.request
- the servlet request.response
- the servlet response.Exception
directives
- an array of CachePolicy
response directivesException
response
- HttpServletResponse
to set header todirectives
- an array of CachePolicy
response directivesvalue
- String
of response directivesException
response
- HttpServletResponse
to set header tovalue
- String
of response directives