Skip to content

How to reach httpServletResponse httpServletRequest from MVEL script written in REST services.

mounzer-masri edited this page Jan 22, 2019 · 1 revision

The preserved keyword for response is : httpServletResponse

example :

var cookieVal = "accessToken=; path=/; HttpOnly";
httpServletResponse.setHeader("Set-Cookie", cookieVal);

The preserved keyword for request is : httpServletRequest
example :
var token = null;
if(httpServletRequest.getCookies() != null) {
foreach(cookie : httpServletRequest.getCookies()) {
if (cookie.getName().equals("accessToken")) {
token = cookie.getValue();
}
}
}

l

Clone this wiki locally