Search in sources :

Example 6 with Config

use of lucee.runtime.config.Config in project Lucee by lucee.

the class FDControllerImpl method output.

@Override
public void output(String message) {
    Config config = ThreadLocalPageContext.getConfig();
    PrintWriter out = config == null ? SystemUtil.getPrintWriter(SystemUtil.OUT) : ((ConfigWebImpl) config).getOutWriter();
    SystemOut.print(out, message);
}
Also used : Config(lucee.runtime.config.Config) PrintWriter(java.io.PrintWriter)

Example 7 with Config

use of lucee.runtime.config.Config in project Lucee by lucee.

the class CacheUtil method getCacheConnection.

public static CacheConnection getCacheConnection(PageContext pc, String cacheName) throws IOException {
    pc = ThreadLocalPageContext.get(pc);
    if (pc != null)
        return ((PageContextImpl) pc).getCacheConnection(cacheName);
    Config config = ThreadLocalPageContext.getConfig(pc);
    CacheConnection cc = config.getCacheConnections().get(cacheName.toLowerCase().trim());
    if (cc == null)
        throw noCache(config, cacheName);
    return cc;
}
Also used : Config(lucee.runtime.config.Config)

Example 8 with Config

use of lucee.runtime.config.Config in project Lucee by lucee.

the class CacheUtil method getCacheConnection.

public static CacheConnection getCacheConnection(PageContext pc, String cacheName, CacheConnection defaultValue) {
    pc = ThreadLocalPageContext.get(pc);
    if (pc != null)
        return ((PageContextImpl) pc).getCacheConnection(cacheName, null);
    Config config = ThreadLocalPageContext.getConfig(pc);
    CacheConnection cc = config.getCacheConnections().get(cacheName.toLowerCase().trim());
    if (cc == null)
        return defaultValue;
    return cc;
}
Also used : Config(lucee.runtime.config.Config)

Example 9 with Config

use of lucee.runtime.config.Config in project Lucee by lucee.

the class MappingUtil method searchMappingRecursive.

public static PageSource searchMappingRecursive(Mapping mapping, String name, boolean onlyCFC) {
    if (name.indexOf('/') == -1) {
        // TODO handle this as well?
        Config config = mapping.getConfig();
        ExtensionResourceFilter ext = null;
        if (onlyCFC)
            ext = new ExtensionResourceFilter(Constants.getComponentExtensions(), true, true);
        else {
            ext = new ExtensionResourceFilter(Constants.getExtensions(), true, true);
        // ext.addExtension(config.getComponentExtension());
        }
        if (mapping.isPhysicalFirst()) {
            PageSource ps = searchPhysical(mapping, name, ext);
            if (ps != null)
                return ps;
            ps = searchArchive(mapping, name, onlyCFC);
            if (ps != null)
                return ps;
        } else {
            PageSource ps = searchArchive(mapping, name, onlyCFC);
            if (ps != null)
                return ps;
            ps = searchPhysical(mapping, name, ext);
            if (ps != null)
                return ps;
        }
    }
    return null;
}
Also used : Config(lucee.runtime.config.Config) ExtensionResourceFilter(lucee.commons.io.res.filter.ExtensionResourceFilter) PageSource(lucee.runtime.PageSource)

Example 10 with Config

use of lucee.runtime.config.Config in project Lucee by lucee.

the class CookieImpl method initialize.

@Override
public void initialize(PageContext pc) {
    Config config = ThreadLocalPageContext.getConfig(pc);
    charset = pc.getWebCharset().name();
    if (scriptProtected == ScriptProtected.UNDEFINED) {
        scriptProtected = ((pc.getApplicationContext().getScriptProtect() & ApplicationContext.SCRIPT_PROTECT_COOKIE) > 0) ? ScriptProtected.YES : ScriptProtected.NO;
    }
    super.initialize(pc);
    HttpServletRequest req = pc.getHttpServletRequest();
    this.rsp = pc.getHttpServletResponse();
    javax.servlet.http.Cookie[] cookies = ReqRspUtil.getCookies(req, pc.getWebCharset());
    for (int i = 0; i < cookies.length; i++) {
        set(config, cookies[i]);
    }
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) Config(lucee.runtime.config.Config)

Aggregations

Config (lucee.runtime.config.Config)25 ConfigWeb (lucee.runtime.config.ConfigWeb)4 ConfigImpl (lucee.runtime.config.ConfigImpl)3 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 Cache (lucee.commons.io.cache.Cache)2 Log (lucee.commons.io.log.Log)2 Resource (lucee.commons.io.res.Resource)2 CFMLFactory (lucee.runtime.CFMLFactory)2 PageContext (lucee.runtime.PageContext)2 ThreadLocalPageContext (lucee.runtime.engine.ThreadLocalPageContext)2 File (java.io.File)1 IOException (java.io.IOException)1 PrintWriter (java.io.PrintWriter)1 Charset (java.nio.charset.Charset)1 SimpleDateFormat (java.text.SimpleDateFormat)1 HashMap (java.util.HashMap)1 ServletConfig (javax.servlet.ServletConfig)1 CacheException (lucee.commons.io.cache.exp.CacheException)1 ResourceProvider (lucee.commons.io.res.ResourceProvider)1 ExtensionResourceFilter (lucee.commons.io.res.filter.ExtensionResourceFilter)1