Search in sources :

Example 41 with PageContext

use of lucee.runtime.PageContext in project Lucee by lucee.

the class HTTPResponseSupport method getCharset.

@Override
public final String getCharset() {
    ContentType ct = getContentType();
    String charset = null;
    if (ct != null)
        charset = ct.getCharset();
    if (!StringUtil.isEmpty(charset))
        return charset;
    PageContext pc = ThreadLocalPageContext.get();
    if (pc != null)
        return pc.getWebCharset().name();
    return "ISO-8859-1";
}
Also used : ContentType(lucee.commons.io.res.ContentType) PageContext(lucee.runtime.PageContext) ThreadLocalPageContext(lucee.runtime.engine.ThreadLocalPageContext)

Example 42 with PageContext

use of lucee.runtime.PageContext in project Lucee by lucee.

the class CharsetUtil method getWebCharset.

public static Charset getWebCharset() {
    PageContext pc = ThreadLocalPageContext.get();
    if (pc != null)
        return pc.getWebCharset();
    Config config = ThreadLocalPageContext.getConfig();
    if (config != null)
        return config.getWebCharset();
    return CharsetUtil.ISO88591;
}
Also used : Config(lucee.runtime.config.Config) PageContext(lucee.runtime.PageContext) ThreadLocalPageContext(lucee.runtime.engine.ThreadLocalPageContext)

Example 43 with PageContext

use of lucee.runtime.PageContext in project Lucee by lucee.

the class SessionTracker method getSessionCollection.

public static Struct getSessionCollection(String appName) {
    PageContext pc = ThreadLocalPageContext.get();
    ScopeContext sc = ((CFMLFactoryImpl) pc.getCFMLFactory()).getScopeContext();
    return sc.getAllSessionScopes(appName);
}
Also used : ScopeContext(lucee.runtime.type.scope.ScopeContext) CFMLFactoryImpl(lucee.runtime.CFMLFactoryImpl) PageContext(lucee.runtime.PageContext) ThreadLocalPageContext(lucee.runtime.engine.ThreadLocalPageContext)

Example 44 with PageContext

use of lucee.runtime.PageContext in project Lucee by lucee.

the class SessionTracker method getSessionCount.

public static int getSessionCount() {
    PageContext pc = ThreadLocalPageContext.get();
    ScopeContext sc = ((CFMLFactoryImpl) pc.getCFMLFactory()).getScopeContext();
    return sc.getSessionCount(pc);
}
Also used : ScopeContext(lucee.runtime.type.scope.ScopeContext) CFMLFactoryImpl(lucee.runtime.CFMLFactoryImpl) PageContext(lucee.runtime.PageContext) ThreadLocalPageContext(lucee.runtime.engine.ThreadLocalPageContext)

Aggregations

PageContext (lucee.runtime.PageContext)44 ThreadLocalPageContext (lucee.runtime.engine.ThreadLocalPageContext)32 PageException (lucee.runtime.exp.PageException)11 Component (lucee.runtime.Component)7 PageContextImpl (lucee.runtime.PageContextImpl)6 IOException (java.io.IOException)5 Key (lucee.runtime.type.Collection.Key)5 Pair (lucee.commons.lang.Pair)4 ConfigWeb (lucee.runtime.config.ConfigWeb)4 Entry (java.util.Map.Entry)3 CFMLEngine (lucee.loader.engine.CFMLEngine)3 CFMLFactory (lucee.runtime.CFMLFactory)3 CFMLFactoryImpl (lucee.runtime.CFMLFactoryImpl)3 ConfigWebImpl (lucee.runtime.config.ConfigWebImpl)3 ArrayList (java.util.ArrayList)2 Cookie (javax.servlet.http.Cookie)2 TypeMapping (javax.xml.rpc.encoding.TypeMapping)2 DevNullOutputStream (lucee.commons.io.DevNullOutputStream)2 ComponentScope (lucee.runtime.ComponentScope)2 Config (lucee.runtime.config.Config)2