当前位置: 首页>>代码示例>>Java>>正文


Java Session.exists方法代码示例

本文整理汇总了Java中org.apache.wicket.Session.exists方法的典型用法代码示例。如果您正苦于以下问题:Java Session.exists方法的具体用法?Java Session.exists怎么用?Java Session.exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.wicket.Session的用法示例。


在下文中一共展示了Session.exists方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadStringResource

import org.apache.wicket.Session; //导入方法依赖的package包/类
@Override
public String loadStringResource(Component component, String key, Locale locale, String style, String variation) {
    if (locale == null) {
        locale = Session.exists() ? Session.get().getLocale() : Locale.getDefault();
    }

    ResourceBundle.Control control = new UTF8Control();
    try {
        return ResourceBundle.getBundle(bundleName, locale, control).getString(key);
    } catch (MissingResourceException ex) {
        try {
            return ResourceBundle.getBundle(bundleName, locale,
                    Thread.currentThread().getContextClassLoader(), control).getString(key);
        } catch (MissingResourceException ex2) {
            return null;
        }
    }
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:19,代码来源:Utf8BundleStringResourceLoader.java

示例2: setupContext

import org.apache.wicket.Session; //导入方法依赖的package包/类
protected void setupContext(Application application, Session session) {
	if (!Application.exists() && application != null) {
		ThreadContext.setApplication(application);
	}
	if (!Session.exists() && session != null) {
		ThreadContext.setSession(session);
	}
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:9,代码来源:SecurityContextAwareCallable.java

示例3: getDefaultLocale

import org.apache.wicket.Session; //导入方法依赖的package包/类
private Locale getDefaultLocale() {
	if (Session.exists()) {
		return Session.get().getLocale();
	} else {
		return propertyService.get(SpringPropertyIds.DEFAULT_LOCALE);
	}
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:8,代码来源:AbstractNotificationContentDescriptorFactory.java

示例4: getLocale

import org.apache.wicket.Session; //导入方法依赖的package包/类
public static Locale getLocale(final long languageId) {
	Locale loc = LabelDao.getLocale(languageId);
	if (loc == null) {
		loc = Session.exists() ? WebSession.get().getLocale() : Locale.ENGLISH;
	}
	return loc;
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:8,代码来源:Application.java

示例5: applyFacetValueFromParameter

import org.apache.wicket.Session; //导入方法依赖的package包/类
private void applyFacetValueFromParameter(StringValue facetValue, final HashMap<String, FacetSelection> selection) {
    final List<String> fq = FILTER_SPLITTER.splitToList(facetValue.toString());
    if (fq.size() == 2) {
        // we have a facet - value pair

        //get facet name, may be a case of "not"
        final String facetString = fq.get(0);
        //check if negated
        final boolean negated = facetString.startsWith("-");

        //get actual facet name
        final String requestedFacet;
        if (negated) {
            //skip negation for actual facet name
            requestedFacet = facetString.substring(1);
        } else {
            requestedFacet = facetString;
        }
        final String facet = facetParamMapper.getFacet(requestedFacet);

        final String value = facetParamMapper.getValue(requestedFacet, fq.get(1));
        if (isAllowedFacetName(facet)) {
            if (selection.containsKey(facet)) {
                selection.get(facet).getValues().add(value);
            } else {
                selection.put(facet, new FacetSelection(Arrays.asList(value)));
            }
            if (negated) {
                //negate selection
                selection.get(facet).setQualifier(value, FacetSelectionValueQualifier.NOT);
            }
        } else {
            logger.debug("Undefined facet passed into query parameter {}: {}", FILTER_QUERY, facet);

            if (Session.exists()) {
                // generate Wicket error message
                Session.get().error("Unknown facet: " + facet);
            }
        }
    } else {
        logger.info("Illegal query parameter value for {}: {}", FILTER_QUERY, facetValue);
    }
}
 
开发者ID:acdh-oeaw,项目名称:vlo-curation,代码行数:44,代码来源:QueryFacetsSelectionParametersConverter.java

示例6: cacheEnabled

import org.apache.wicket.Session; //导入方法依赖的package包/类
private boolean cacheEnabled() {
    return Session.exists();
}
 
开发者ID:opensingular,项目名称:singular-server,代码行数:4,代码来源:WicketSessionCacheManager.java


注:本文中的org.apache.wicket.Session.exists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。