當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。