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);
}
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;
}
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;
}
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;
}
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]);
}
}
Aggregations