Search in sources :

Example 1 with URLImpl

use of lucee.runtime.type.scope.URLImpl in project Lucee by lucee.

the class PageContextImpl method initialize.

/**
 * initialize a existing page context
 * @param servlet
 * @param req
 * @param rsp
 * @param errorPageURL
 * @param needsSession
 * @param bufferSize
 * @param autoFlush
 */
public PageContextImpl initialize(HttpServlet servlet, HttpServletRequest req, HttpServletResponse rsp, String errorPageURL, boolean needsSession, int bufferSize, boolean autoFlush, boolean isChild, boolean ignoreScopes) {
    parent = null;
    appListenerType = ApplicationListener.TYPE_NONE;
    this.ignoreScopes = ignoreScopes;
    requestId = counter++;
    ReqRspUtil.setContentType(rsp, "text/html; charset=" + config.getWebCharset().name());
    this.isChild = isChild;
    applicationContext = defaultApplicationContext;
    startTime = System.currentTimeMillis();
    thread = Thread.currentThread();
    this.req = new HTTPServletRequestWrap(req);
    this.rsp = rsp;
    this.servlet = servlet;
    // Writers
    if (config.debugLogOutput()) {
        CFMLWriter w = config.getCFMLWriter(this, req, rsp);
        w.setAllowCompression(false);
        DebugCFMLWriter dcw = new DebugCFMLWriter(w);
        bodyContentStack.init(dcw);
        debugger.setOutputLog(dcw);
    } else {
        bodyContentStack.init(config.getCFMLWriter(this, req, rsp));
    }
    writer = bodyContentStack.getWriter();
    forceWriter = writer;
    // Scopes
    server = ScopeContext.getServerScope(this, ignoreScopes);
    if (hasFamily) {
        variablesRoot = new VariablesImpl();
        variables = variablesRoot;
        request = new RequestImpl();
        _url = new URLImpl();
        _form = new FormImpl();
        urlForm = new UrlFormImpl(_form, _url);
        undefined = new UndefinedImpl(this, getScopeCascadingType());
        hasFamily = false;
    } else if (variables == null) {
        variablesRoot = new VariablesImpl();
        variables = variablesRoot;
    }
    request.initialize(this);
    if (config.mergeFormAndURL()) {
        url = urlForm;
        form = urlForm;
    } else {
        url = _url;
        form = _form;
    }
    // url.initialize(this);
    // form.initialize(this);
    // undefined.initialize(this);
    psq = config.getPSQL();
    fdEnabled = !config.allowRequestTimeout();
    if (config.getExecutionLogEnabled())
        this.execLog = config.getExecutionLogFactory().getInstance(this);
    if (debugger != null)
        debugger.init(config);
    undefined.initialize(this);
    timeoutStacktrace = null;
    return this;
}
Also used : UrlFormImpl(lucee.runtime.type.scope.UrlFormImpl) UndefinedImpl(lucee.runtime.type.scope.UndefinedImpl) HTTPServletRequestWrap(lucee.runtime.net.http.HTTPServletRequestWrap) DebugCFMLWriter(lucee.runtime.debug.DebugCFMLWriter) CFMLWriter(lucee.runtime.writer.CFMLWriter) UrlFormImpl(lucee.runtime.type.scope.UrlFormImpl) FormImpl(lucee.runtime.type.scope.FormImpl) VariablesImpl(lucee.runtime.type.scope.VariablesImpl) DebugCFMLWriter(lucee.runtime.debug.DebugCFMLWriter) RequestImpl(lucee.runtime.type.scope.RequestImpl) URLImpl(lucee.runtime.type.scope.URLImpl)

Example 2 with URLImpl

use of lucee.runtime.type.scope.URLImpl in project Lucee by lucee.

the class HTTPServletRequestWrap method getParameterValues.

public static String[] getParameterValues(PageContext pc, String name) {
    pc = ThreadLocalPageContext.get(pc);
    FormImpl form = _form(pc);
    URLImpl url = _url(pc);
    return ScopeUtil.getParameterValues(new URLItem[][] { form.getRaw(), url.getRaw() }, new String[] { form.getEncoding(), url.getEncoding() }, name);
}
Also used : UrlFormImpl(lucee.runtime.type.scope.UrlFormImpl) FormImpl(lucee.runtime.type.scope.FormImpl) URLImpl(lucee.runtime.type.scope.URLImpl)

Example 3 with URLImpl

use of lucee.runtime.type.scope.URLImpl in project Lucee by lucee.

the class HTTPServletRequestWrap method getParameterMap.

@Override
public Map<String, String[]> getParameterMap() {
    PageContext pc = ThreadLocalPageContext.get();
    FormImpl form = _form(pc);
    URLImpl url = _url(pc);
    return ScopeUtil.getParameterMap(new URLItem[][] { form.getRaw(), url.getRaw() }, new String[] { form.getEncoding(), url.getEncoding() });
}
Also used : UrlFormImpl(lucee.runtime.type.scope.UrlFormImpl) FormImpl(lucee.runtime.type.scope.FormImpl) PageContext(lucee.runtime.PageContext) ThreadLocalPageContext(lucee.runtime.engine.ThreadLocalPageContext) URLImpl(lucee.runtime.type.scope.URLImpl)

Aggregations

FormImpl (lucee.runtime.type.scope.FormImpl)3 URLImpl (lucee.runtime.type.scope.URLImpl)3 UrlFormImpl (lucee.runtime.type.scope.UrlFormImpl)3 PageContext (lucee.runtime.PageContext)1 DebugCFMLWriter (lucee.runtime.debug.DebugCFMLWriter)1 ThreadLocalPageContext (lucee.runtime.engine.ThreadLocalPageContext)1 HTTPServletRequestWrap (lucee.runtime.net.http.HTTPServletRequestWrap)1 RequestImpl (lucee.runtime.type.scope.RequestImpl)1 UndefinedImpl (lucee.runtime.type.scope.UndefinedImpl)1 VariablesImpl (lucee.runtime.type.scope.VariablesImpl)1 CFMLWriter (lucee.runtime.writer.CFMLWriter)1