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


Java PageProvider类代码示例

本文整理汇总了Java中org.apache.wicket.core.request.handler.PageProvider的典型用法代码示例。如果您正苦于以下问题:Java PageProvider类的具体用法?Java PageProvider怎么用?Java PageProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PageProvider类属于org.apache.wicket.core.request.handler包,在下文中一共展示了PageProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getExceptionMapperProvider

import org.apache.wicket.core.request.handler.PageProvider; //导入依赖的package包/类
@Override
public final IProvider<IExceptionMapper> getExceptionMapperProvider() {
	return new IProvider<IExceptionMapper>() {

		@Override
		public IExceptionMapper get() {
			return new DefaultExceptionMapper() {

				@Override
				protected IRequestHandler mapExpectedExceptions(Exception e, Application application) {
					Page errorPage = mapExceptions(e);
					if (errorPage != null) {
						return createPageRequestHandler(new PageProvider(errorPage));
					} else {
						return super.mapExpectedExceptions(e, application);
					}
				}
				
			};
		}
		
	};
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:24,代码来源:GitPlexWebApplication.java

示例2: init

import org.apache.wicket.core.request.handler.PageProvider; //导入依赖的package包/类
/**
 * @see org.apache.wicket.Application#init()
 */
@Override
public void init()
{
	super.init();

	// TODO STEP 7b: uncomment to enable injection of fortress spring beans:
	getComponentInstantiationListeners().add(new SpringComponentInjector(this));

	// Catch runtime exceptions this way:
	getRequestCycleListeners().add( new AbstractRequestCycleListener()
	{
		@Override
		public IRequestHandler onException( RequestCycle cycle, Exception e )
		{
			return new RenderPageRequestHandler( new PageProvider( new ErrorPage( e ) ) );
		}
	} );
	getMarkupSettings().setStripWicketTags(true);

	getRequestCycleSettings().setRenderStrategy( RequestCycleSettings.RenderStrategy.ONE_PASS_RENDER);
}
 
开发者ID:shawnmckinney,项目名称:fortress-saml-demo,代码行数:25,代码来源:WicketApplication.java

示例3: BodyFrame

import org.apache.wicket.core.request.handler.PageProvider; //导入依赖的package包/类
/**
 * Constructor
 */
public BodyFrame() {
	frameTarget = new TargetFrame(DefaultPage.class);
	leftFrame = new NavigationFrame(this);
	getSession().getPageManager().touchPage(leftFrame);
	IRequestHandler leftFrameHandler = new RenderPageRequestHandler(new PageProvider(leftFrame));
	ExtendedFrame leftFrameTag = new ExtendedFrame("leftFrame", leftFrameHandler);
	add(leftFrameTag);

	ExtendedFrame rightFrameTag = new ExtendedFrame("rightFrame") {
		/** */
		private static final long serialVersionUID = 1L;

		@Override
		protected CharSequence getUrl() {
			return frameTarget.getUrl();
		}
	};
	add(rightFrameTag);
}
 
开发者ID:citlab,项目名称:Intercloud,代码行数:23,代码来源:BodyFrame.java

示例4: init

import org.apache.wicket.core.request.handler.PageProvider; //导入依赖的package包/类
@Override
public void init()
{
    super.init();
    getComponentInstantiationListeners().add( new SpringComponentInjector( this ) );

    // Catch runtime exceptions this way:
    getRequestCycleListeners().add( new AbstractRequestCycleListener()
    {
        @Override
        public IRequestHandler onException( RequestCycle cycle, Exception e )
        {
            return new RenderPageRequestHandler( new PageProvider( new ErrorPage( e ) ) );
        }
    } );
    getMarkupSettings().setStripWicketTags( true );
}
 
开发者ID:apache,项目名称:directory-fortress-commander,代码行数:18,代码来源:ApplicationContext.java

示例5: init

import org.apache.wicket.core.request.handler.PageProvider; //导入依赖的package包/类
/**
 * @see org.apache.wicket.Application#init()
 */
@Override
public void init()
{
	super.init();

	// Enable injection of fortress spring beans:
	getComponentInstantiationListeners().add(new SpringComponentInjector(this));

	// Catch runtime exceptions this way:
	getRequestCycleListeners().add( new AbstractRequestCycleListener()
	{
		@Override
		public IRequestHandler onException( RequestCycle cycle, Exception e )
		{
			return new RenderPageRequestHandler( new PageProvider( new ErrorPage( e ) ) );
		}
	} );
	getMarkupSettings().setStripWicketTags(true);
	getRequestCycleSettings().setRenderStrategy( RequestCycleSettings.RenderStrategy.ONE_PASS_RENDER);
}
 
开发者ID:shawnmckinney,项目名称:role-engineering-sample,代码行数:24,代码来源:WicketApplication.java

示例6: onException

import org.apache.wicket.core.request.handler.PageProvider; //导入依赖的package包/类
@Override
public IRequestHandler onException(RequestCycle cycle, Exception ex) {
	if (ex instanceof EntityNotFoundException) {
		return createPageRequestHandler(new PageProvider(new EntityNotFoundErrorPage((EntityNotFoundException) ex)));
	} else if (ex.getCause() instanceof InvocationTargetException) {
		Throwable targetException = ((InvocationTargetException) ex.getCause()).getTargetException();
		if (targetException instanceof EntityNotFoundException) {
			return createPageRequestHandler(new PageProvider(new EntityNotFoundErrorPage((EntityNotFoundException) targetException)));
		}
	}
	if (deploymentMode) {
		return createPageRequestHandler(new PageProvider(new ErrorPage(ex)));
	} else {
		return super.onException(cycle, ex);
	}
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:17,代码来源:UQasarExceptionRequestCycleListener.java

示例7: createPageRequestHandler

import org.apache.wicket.core.request.handler.PageProvider; //导入依赖的package包/类
private RenderPageRequestHandler createPageRequestHandler(PageProvider pageProvider) {
	RequestCycle requestCycle = RequestCycle.get();

	if (requestCycle == null) {
		throw new IllegalStateException("there is no current request cycle attached to this thread");
	}

	/*
	 * Use NEVER_REDIRECT policy to preserve the original page's URL for
	 * non-Ajax requests and always redirect for ajax requests
	 */
	RenderPageRequestHandler.RedirectPolicy redirect = RenderPageRequestHandler.RedirectPolicy.NEVER_REDIRECT;

	if (isProcessingAjaxRequest()) {
		redirect = RenderPageRequestHandler.RedirectPolicy.AUTO_REDIRECT;
	}

	return new RenderPageRequestHandler(pageProvider, redirect);
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:20,代码来源:UQasarExceptionRequestCycleListener.java

示例8: init

import org.apache.wicket.core.request.handler.PageProvider; //导入依赖的package包/类
/**
 * @see org.apache.wicket.Application#init()
 */
@Override
public void init()
{
	super.init();
	// add your configuration here
       getComponentInstantiationListeners().add(new SpringComponentInjector(this));

       // Catch runtime exceptions this way:
       getRequestCycleListeners().add( new AbstractRequestCycleListener()
       {
           @Override
           public IRequestHandler onException( RequestCycle cycle, Exception e )
           {
               return new RenderPageRequestHandler( new PageProvider( new ErrorPage( e ) ) );
           }
       } );

       getMarkupSettings().setStripWicketTags(true);
}
 
开发者ID:shawnmckinney,项目名称:fortressdemo2,代码行数:23,代码来源:WicketApplication.java

示例9: createPageRequestHandler

import org.apache.wicket.core.request.handler.PageProvider; //导入依赖的package包/类
private RenderPageRequestHandler createPageRequestHandler(PageProvider pageProvider) {
    RequestCycle requestCycle = RequestCycle.get();

    if (requestCycle == null) {
        throw new IllegalStateException("there is no current request cycle attached to this thread");
    }

    /*
     * Use NEVER_REDIRECT policy to preserve the original page's URL for
     * non-Ajax requests and always redirect for ajax requests
     */
    RenderPageRequestHandler.RedirectPolicy redirect = RenderPageRequestHandler.RedirectPolicy.NEVER_REDIRECT;

    if (isProcessingAjaxRequest()) {
        redirect = RenderPageRequestHandler.RedirectPolicy.AUTO_REDIRECT;
    }

    return new RenderPageRequestHandler(pageProvider, redirect);
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:20,代码来源:DMDLoggingRequestCycleListener.java

示例10: internalMap

import org.apache.wicket.core.request.handler.PageProvider; //导入依赖的package包/类
private IRequestHandler internalMap(Exception e) {
    final Application application = Application.get();

    // check if we are processing an Ajax request and if we want to invoke the failure handler
    if (isAjaxRequest() && shouldInvokeClientSideFailureHandler(application)) {
        return new ErrorCodeRequestHandler(INTERNAL_SERVER_ERROR);
    }

    if (e instanceof StalePageException) {
        // If the page was stale, just re-render it (the url should always be updated by an redirect in that case)
        return new RenderPageRequestHandler(new PageProvider(((StalePageException) e).getPage()));
    } else if (e instanceof PageExpiredException) {
        return createPageRequestHandler(application.getApplicationSettings().getPageExpiredErrorPage());
    } else if (e instanceof AuthorizationException || e instanceof ListenerInvocationNotAllowedException) {
        return createPageRequestHandler(application.getApplicationSettings().getAccessDeniedPage());
    } else if (e instanceof ResponseIOException) {
        LOG.error("Connection lost, give up responding.", e);
        return new EmptyRequestHandler();
    } else
        if (e instanceof PackageResource.PackageResourceBlockedException && application.usesDeploymentConfig()) {
        LOG.debug(e.getMessage(), e);
        return new ErrorCodeRequestHandler(NOT_FOUND);
    }

    return mapUnexpectedException(e);
}
 
开发者ID:flex-oss,项目名称:flex-ui,代码行数:27,代码来源:AbstractExceptionMapper.java

示例11: onException

import org.apache.wicket.core.request.handler.PageProvider; //导入依赖的package包/类
@Override
public IRequestHandler onException(RequestCycle cycle, Exception e) {
	if (e instanceof PageExpiredException) {
		LOG.error("Page expired", e); // !?
		return null; // see
						// getApplicationSettings().setPageExpiredErrorPage
	}

	if (e instanceof MaintenanceException) {
		return new RenderPageRequestHandler(new PageProvider(MaintenancePage.class));
	}

	if (e instanceof StalePageException) {
		return null;
	}

	String errorCode = String.valueOf(System.currentTimeMillis());
	LOG.error("Error with code " + errorCode, e);

	PageParameters parameters = new PageParameters();
	parameters.add("errorCode", errorCode);
	parameters.add("errorMessage", UrlEncoder.QUERY_INSTANCE.encode(e.getMessage(), HTTP.ISO_8859_1));
	return new RenderPageRequestHandler(new PageProvider(ErrorPage.class, parameters));
}
 
开发者ID:nextreports,项目名称:nextreports-server,代码行数:25,代码来源:NextServerApplication.java

示例12: onException

import org.apache.wicket.core.request.handler.PageProvider; //导入依赖的package包/类
@Override
public IRequestHandler onException(RequestCycle cycle, Exception ex) {
    if (REQUEST_LOGGER.isTraceEnabled()) {
        REQUEST_LOGGER.trace("REQUEST CYCLE: Exception: {}, handler {}", ex,
                WebComponentUtil.debugHandler(cycle.getActiveRequestHandler()), ex);
    }
    LoggingUtils.logUnexpectedException(LOGGER, "Error occurred during page rendering", ex);
    return new RenderPageRequestHandler(new PageProvider(new PageError(ex)));
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:10,代码来源:LoggingRequestCycleListener.java

示例13: onException

import org.apache.wicket.core.request.handler.PageProvider; //导入依赖的package包/类
@Override
public IRequestHandler onException(RequestCycle cycle, Exception ex) {
    SingularException singularException = getFirstSingularException(ex);
    if (singularException instanceof SingularServerException
            && ((WebRequest) RequestCycle.get().getRequest()).isAjax()) {
        return new AjaxErrorRequestHandler(singularException);
    } else if (ex instanceof PageExpiredException) {
        return new RenderPageRequestHandler(new PageProvider(new Page410()));
    } else {
        return new RenderPageRequestHandler(new PageProvider(new Page500(ex)));
    }
}
 
开发者ID:opensingular,项目名称:singular-server,代码行数:13,代码来源:SingularServerContextListener.java

示例14: Index

import org.apache.wicket.core.request.handler.PageProvider; //导入依赖的package包/类
/**
 * Constructor
 */
public Index() {
	IRequestHandler topFrameHandler = new BookmarkablePageRequestHandler(new PageProvider(TopFrame.class));
	ExtendedFrame topFrame = new ExtendedFrame("topFrame", topFrameHandler);
	add(topFrame);

	IRequestHandler bodyFrameHandler = new BookmarkablePageRequestHandler(new PageProvider(BodyFrame.class));
	ExtendedFrame bodyFrame = new ExtendedFrame("bodyFrame", bodyFrameHandler);
	add(bodyFrame);
}
 
开发者ID:citlab,项目名称:Intercloud,代码行数:13,代码来源:Index.java

示例15: processHybrid

import org.apache.wicket.core.request.handler.PageProvider; //导入依赖的package包/类
@Override
protected IRequestHandler processHybrid(PageInfo pageInfo, Class<? extends IRequestablePage> pageClass,
		PageParameters pageParameters, Integer renderCount) {
	IRequestHandler handler = super.processHybrid(pageInfo, pageClass, pageParameters, renderCount);
	if (handler instanceof RenderPageRequestHandler) {
		// in the current implementation (wicket 1.5.6) super.processHybrid
		// returns a RenderPageRequestHandler
		RenderPageRequestHandler renderPageHandler = (RenderPageRequestHandler) handler;
		if (renderPageHandler.getPageProvider() instanceof PageProvider) {
			PageProvider provider = (PageProvider) renderPageHandler.getPageProvider();
			// This check is necessary to prevent a
			// RestartResponseAtInterceptPageException at the wrong time in
			// request cycle
			if (provider.hasPageInstance()) {
				PageParameters newPageParameters = renderPageHandler.getPageParameters();
				PageParameters oldPageParameters = renderPageHandler.getPageProvider().getPageInstance()
						.getPageParameters();
				// if we recognize a change between the page parameter of
				// the loaded
				// page and the page parameter of the current request, we
				// redirect
				// to a fresh bookmarkable instance of that page.
				if (!PageParameters.equals(oldPageParameters, newPageParameters)) {
					handler = processBookmarkable(pageClass, newPageParameters);
				}
			}
		}
	}
	return handler;
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:31,代码来源:PageParameterAwareMountedMapper.java


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