本文整理匯總了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;
}
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例6: cacheEnabled
import org.apache.wicket.Session; //導入方法依賴的package包/類
private boolean cacheEnabled() {
return Session.exists();
}