本文整理汇总了Java中org.apache.wicket.core.request.handler.IPageRequestHandler类的典型用法代码示例。如果您正苦于以下问题:Java IPageRequestHandler类的具体用法?Java IPageRequestHandler怎么用?Java IPageRequestHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPageRequestHandler类属于org.apache.wicket.core.request.handler包,在下文中一共展示了IPageRequestHandler类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getComponent
import org.apache.wicket.core.request.handler.IPageRequestHandler; //导入依赖的package包/类
private Component getComponent() {
if (component == null && !NESTED_PAGE_RETRIEVAL.get()) {
NESTED_PAGE_RETRIEVAL.set(true);
try {
final IPageRequestHandler handler = PageRequestHandlerTracker.getLastHandler(RequestCycle.get());
if (handler != null) {
if (componentClass != null) {
final Component foundComponent = Components.findComponent(componentClass,
(Page) handler.getPage());
if (foundComponent != null) {
return foundComponent;
}
}
return (Page) handler.getPage();
}
} finally {
NESTED_PAGE_RETRIEVAL.set(false);
}
}
return component;
}
示例2: extractCurrentPage
import org.apache.wicket.core.request.handler.IPageRequestHandler; //导入依赖的package包/类
private Page extractCurrentPage(boolean fullSearch)
{
final RequestCycle requestCycle = RequestCycle.get();
IRequestHandler handler = requestCycle.getActiveRequestHandler();
if (handler == null)
{
handler = requestCycle.getRequestHandlerScheduledAfterCurrent();
if(handler==null && fullSearch) {
handler = OrientDbWebApplication.get().getRootRequestMapper().mapRequest(requestCycle.getRequest());
}
}
if (handler instanceof IPageRequestHandler)
{
IPageRequestHandler pageRequestHandler = (IPageRequestHandler)handler;
return (Page)pageRequestHandler.getPage();
}
return null;
}
示例3: extractCurrentPage
import org.apache.wicket.core.request.handler.IPageRequestHandler; //导入依赖的package包/类
/**
* Returns the page being rendered when the exception was thrown, or {@code null} if it cannot be extracted.
*
* @return a Page
*/
private Page extractCurrentPage() {
RequestCycle requestCycle = RequestCycle.get();
if (requestCycle == null) {
return null;
}
IRequestHandler handler = requestCycle.getActiveRequestHandler();
if (handler == null) {
handler = requestCycle.getRequestHandlerScheduledAfterCurrent();
}
if (handler instanceof IPageRequestHandler) {
return (Page) ((IPageRequestHandler) handler).getPage();
} else {
return null;
}
}
示例4: getPage
import org.apache.wicket.core.request.handler.IPageRequestHandler; //导入依赖的package包/类
@Nullable
public static Page getPage() {
if (RequestCycle.get() != null && RequestCycle.get().getActiveRequestHandler() instanceof IPageRequestHandler) {
return (Page) ((IPageRequestHandler) RequestCycle.get().getActiveRequestHandler()).getPage();
} else {
return null;
}
}
示例5: onEndRequest
import org.apache.wicket.core.request.handler.IPageRequestHandler; //导入依赖的package包/类
@Override
public void onEndRequest(final RequestCycle cycle) {
final IPageRequestHandler handler = PageRequestHandlerTracker.getLastHandler(cycle);
if (handler != null) {
PageFactory.get().updatePage((Page) handler.getPage());
}
}
示例6: getCommentedFiles
import org.apache.wicket.core.request.handler.IPageRequestHandler; //导入依赖的package包/类
@SuppressWarnings("unused")
private static List<String> getCommentedFiles() {
IPageRequestHandler handler = (IPageRequestHandler) RequestCycle.get().getActiveRequestHandler();
return ((CodeCommentsPage)handler.getPage()).getCommentedFiles();
}
示例7: initExceptionPages
import org.apache.wicket.core.request.handler.IPageRequestHandler; //导入依赖的package包/类
public static final void initExceptionPages(WebApplication application) {
application.getExceptionSettings().setUnexpectedExceptionDisplay(
IExceptionSettings.SHOW_EXCEPTION_PAGE);
application.getExceptionSettings().setThreadDumpStrategy(
ThreadDumpStrategy.ALL_THREADS);
application.getExceptionSettings().setAjaxErrorHandlingStrategy(
AjaxErrorStrategy.REDIRECT_TO_ERROR_PAGE);
application.getApplicationSettings().setAccessDeniedPage(
AccessDeniedPage.class);
application.getApplicationSettings().setInternalErrorPage(
InternalErrorPage.class);
application.getApplicationSettings().setPageExpiredErrorPage(
PageExpiredErrorPage.class);
application.getRequestCycleListeners().add(
new AbstractRequestCycleListener() {
@Override
public IRequestHandler onException(RequestCycle cycle,
Exception e) {
Page currentPage = null;
IRequestHandler handler = cycle
.getActiveRequestHandler();
if (handler == null) {
handler = cycle
.getRequestHandlerScheduledAfterCurrent();
}
if (handler instanceof IPageRequestHandler) {
IPageRequestHandler pageRequestHandler = (IPageRequestHandler) handler;
currentPage = (Page) pageRequestHandler.getPage();
}
return new RenderPageRequestHandler(new PageProvider(
new ExceptionErrorPage(e, currentPage)));
}
});
}