本文整理匯總了Java中org.apache.wicket.request.mapper.parameter.PageParameters.remove方法的典型用法代碼示例。如果您正苦於以下問題:Java PageParameters.remove方法的具體用法?Java PageParameters.remove怎麽用?Java PageParameters.remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.wicket.request.mapper.parameter.PageParameters
的用法示例。
在下文中一共展示了PageParameters.remove方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processTheme
import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
/**
* Sets the theme from the page parameters if applicable. An present but
* empty theme value will reset the theme (by unsetting the style).
*
* @param parameters page parameters to process
* @see VloWebAppParameters#THEME
* @see Session#setStyle(java.lang.String)
*/
private void processTheme(PageParameters parameters) {
final StringValue themeValue = parameters.get(VloWebAppParameters.THEME);
if (!themeValue.isNull()) {
if (themeValue.isEmpty()) {
// empty string resets theme
logger.debug("Resetting theme");
Session.get().setStyle(null);
} else {
// theme found, set it as style in the session
final String theme = themeValue.toString().toLowerCase();
logger.debug("Setting theme to {}", theme);
Session.get().setStyle(theme);
}
/*
* Remove theme parameter to prevent it from interfering with
* further processing, specifically the parameters check in
* the simple page search
*/
parameters.remove(VloWebAppParameters.THEME, themeValue.toString());
}
}
示例2: encodePageParameters
import org.apache.wicket.request.mapper.parameter.PageParameters; //導入方法依賴的package包/類
@Override
protected Url encodePageParameters(Url url, PageParameters pageParameters, IPageParametersEncoder encoder) {
//get special page parameter that encodes the page fragment/anchor
final StringValue fragment = pageParameters.get(FRAGMENT_PAGE_PARAMETER);
if (fragment.isEmpty()) {
//business as usual
return super.encodePageParameters(url, pageParameters, encoder);
} else {
//we have a fragment parameter, remove from normal parameters and do post-processing
pageParameters.remove(FRAGMENT_PAGE_PARAMETER);
final Url result = super.encodePageParameters(url, pageParameters, encoder);
//set the fragment on the resulting URL
result.setFragment(fragment.toString());
return result;
}
}