private PageContext createPageContext(CFMLFactory factory,String scriptName,String queryString, OutputStream os, HttpServletRequest formerReq) {
Resource root = factory.getConfig().getRootDirectory();
if(os==null)os=DevNullOutputStream.DEV_NULL_OUTPUT_STREAM;
// Request
HttpServletRequestDummy req = new HttpServletRequestDummy(
root,"localhost",scriptName,queryString,
ReqRspUtil.getCookies(factory.getConfig(),formerReq),
HttpUtil.cloneHeaders(formerReq),
HttpUtil.cloneParameters(formerReq),
HttpUtil.getAttributesAsStruct(formerReq),null);
req.addHeader("AMF-Forward", "true");
HttpServletResponseDummy rsp = new HttpServletResponseDummy(os);
return factory.getRailoPageContext(factory.getServlet(), req, rsp, null, false, -1, false);
}