Search in sources :

Example 1 with Result

use of lucee.runtime.rest.Result in project Lucee by lucee.

the class RestSetResponse method call.

public static String call(PageContext pc, Struct rsp) throws ApplicationException {
    HttpServletRequest req = pc.getHttpServletRequest();
    Result result = (Result) req.getAttribute("rest-result");
    if (result == null)
        throw new ApplicationException("not inside a REST Request");
    result.setCustomResponse(rsp);
    return null;
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) ApplicationException(lucee.runtime.exp.ApplicationException) Result(lucee.runtime.rest.Result)

Aggregations

HttpServletRequest (javax.servlet.http.HttpServletRequest)1 ApplicationException (lucee.runtime.exp.ApplicationException)1 Result (lucee.runtime.rest.Result)1