Package org.apache.wicket.core.request.handler

Examples of org.apache.wicket.core.request.handler.PageProvider


    if (shouldRedirectToPage(requestCycle))
    {
      // the page itself has been added to the request target, we simply issue a redirect
      // back to the page
      IRequestHandler handler = new RenderPageRequestHandler(new PageProvider(page));
      final String url = rc.urlFor(handler).toString();
      response.sendRedirect(url);
      return;
    }
View Full Code Here


   * @return Bookmarkable URL to page
   */
  public final <C extends Page> Url mapUrlFor(final Class<C> pageClass,
    final PageParameters parameters)
  {
    IRequestHandler handler = new BookmarkablePageRequestHandler(new PageProvider(pageClass,
      parameters));
    return mapUrlFor(handler);
  }
View Full Code Here

   * @return Bookmarkable URL to page
   */
  public final <C extends Page> CharSequence urlFor(final Class<C> pageClass,
    final PageParameters parameters)
  {
    IRequestHandler handler = new BookmarkablePageRequestHandler(new PageProvider(pageClass,
      parameters));
    return urlFor(handler);
  }
View Full Code Here

    if (page instanceof Page)
    {
      ((Page) page).setStatelessHint(false);
    }

    scheduleRequestHandlerAfterCurrent(new RenderPageRequestHandler(new PageProvider(page),
      RenderPageRequestHandler.RedirectPolicy.AUTO_REDIRECT));
  }
View Full Code Here

   *
   * @param pageClass
   */
  public void setResponsePage(Class<? extends IRequestablePage> pageClass)
  {
    IPageProvider provider = new PageProvider(pageClass, null);
    scheduleRequestHandlerAfterCurrent(new RenderPageRequestHandler(provider,
      RenderPageRequestHandler.RedirectPolicy.ALWAYS_REDIRECT));
  }
View Full Code Here

   * @param parameters
   */
  public void setResponsePage(Class<? extends IRequestablePage> pageClass,
    PageParameters parameters)
  {
    IPageProvider provider = new PageProvider(pageClass, parameters);
    scheduleRequestHandlerAfterCurrent(new RenderPageRequestHandler(provider,
      RenderPageRequestHandler.RedirectPolicy.ALWAYS_REDIRECT));
  }
View Full Code Here

  @Test
  public void setQueryParameterWhenRequestHasAnQueryUrl()
  {
    PageParameters parameters = new PageParameters();
    parameters.set("q_1", "q_1_value");
    IPageProvider testPageProvider = new PageProvider(MockPageParametersAware.class, parameters);
    IRequestHandler pageRequestHandler = new BookmarkablePageRequestHandler(testPageProvider);
    Url url = tester.getApplication().getRootRequestMapper().mapHandler(pageRequestHandler);
    tester.getRequest().setParameter("q_2", "q_2_value");
    tester.getRequest().setUrl(url);
View Full Code Here

  public void setMultiValueQueryParameter()
  {
    PageParameters parameters = new PageParameters();
    parameters.add("q_1", "q_1_value_1");
    parameters.add("q_1", "q_1_value_2");
    IPageProvider testPageProvider = new PageProvider(MockPageParametersAware.class, parameters);
    IRequestHandler pageRequestHandler = new BookmarkablePageRequestHandler(testPageProvider);
    Url url = tester.getApplication().getRootRequestMapper().mapHandler(pageRequestHandler);
    tester.getRequest().addParameter("q_2", "q_2_value_1");
    tester.getRequest().addParameter("q_2", "q_2_value_2");
    tester.getRequest().setUrl(url);
View Full Code Here

      {
        pageUrl = requestCycle.urlFor(page.getClass(), page.getPageParameters());
      }
      else
      {
        IRequestHandler handler = new RenderPageRequestHandler(new PageProvider(page));
        pageUrl = requestCycle.urlFor(handler);
      }

      appendAssignment(buffer, "settings.src", pageUrl);
    }
View Full Code Here

   * @return a {@code IRequestHandler} capable of processing the bookmarkable request.
   */
  protected IRequestHandler processBookmarkable(Class<? extends IRequestablePage> pageClass,
    PageParameters pageParameters)
  {
    PageProvider provider = new PageProvider(pageClass, pageParameters);
    provider.setPageSource(getContext());
    return new RenderPageRequestHandler(provider);
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.core.request.handler.PageProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.