Package org.apache.wicket

Examples of org.apache.wicket.RestartResponseException


          // logon successful. Continue to the original destination
          if (!continueToOriginalDestination())
          {
            // Ups, no original destination. Go to the home page
            throw new RestartResponseException(getApplication().getSessionSettings()
              .getPageFactory()
              .newPage(getApplication().getHomePage()));
          }
        }
      }
View Full Code Here


      {
        // we haven't done the redirect yet; record that we will be
        // doing that now and redirect
        session.setMetaData(BROWSER_WAS_POLLED_KEY, Boolean.TRUE);
        String url = "/" + getRequest().getUrl();
        throw new RestartResponseException(newBrowserInfoPage(url));
      }
      // if we get here, the redirect already has been done; clear
      // the meta data entry; we don't need it any longer is the client
      // info object will be cached too
      session.setMetaData(BROWSER_WAS_POLLED_KEY, (Boolean)null);
View Full Code Here

          IRequestHandler activeRequestHandler = requestCycle.getActiveRequestHandler();
          String url = requestCycle.urlFor(activeRequestHandler).toString();
          String relativeUrl = requestCycle.getUrlRenderer()
            .renderContextPathRelativeUrl(url, request);
          Page browserInfoPage = newBrowserInfoPage(relativeUrl);
          throw new RestartResponseException(browserInfoPage);
        }
        // if we get here, the redirect already has been done; clear
        // the meta data entry; we don't need it any longer is the client
        // info object will be cached too
        setMetaData(BROWSER_WAS_POLLED_KEY, (Boolean)null);
View Full Code Here

    final Page responsePage = requestCycle.getResponsePage();

    Page override = onRuntimeException(responsePage, e);
    if (override != null)
    {
      throw new RestartResponseException(override);
    }
    else if (e instanceof AuthorizationException)
    {
      // are authorization exceptions always thrown before the real
      // render?
      // else we need to make a page (see below) or set it hard to a
      // redirect.
      Class<? extends Page> accessDeniedPageClass = application.getApplicationSettings()
        .getAccessDeniedPage();

      throw new RestartResponseAtInterceptPageException(accessDeniedPageClass);
    }
    else if (e instanceof PageExpiredException)
    {
      Class<? extends Page> pageExpiredErrorPageClass = application.getApplicationSettings()
        .getPageExpiredErrorPage();
      boolean mounted = isPageMounted(pageExpiredErrorPageClass);
      RequestCycle.get().setRedirect(mounted);
      throw new RestartResponseException(pageExpiredErrorPageClass);
    }
    else if (settings.getUnexpectedExceptionDisplay() != IExceptionSettings.SHOW_NO_EXCEPTION_PAGE)
    {
      // we do not want to redirect - we want to inline the error output
      // and preserve the url so when the refresh button is pressed we
      // rerun the code that caused the error
      // However we don't what to do this in a situation where we are in portlet mode
      if (!RequestContext.get().isPortletRequest())
      {
        requestCycle.setRedirect(false);
      }

      // figure out which error page to show
      Class<? extends Page> internalErrorPageClass = application.getApplicationSettings()
        .getInternalErrorPage();
      Class<? extends Page> responseClass = responsePage != null ? responsePage.getClass()
        : null;

      if (responseClass != internalErrorPageClass &&
        settings.getUnexpectedExceptionDisplay() == IExceptionSettings.SHOW_INTERNAL_ERROR_PAGE)
      {
        throw new RestartResponseException(internalErrorPageClass);
      }
      else if (responseClass != ExceptionErrorPage.class)
      {
        // Show full details
        throw new RestartResponseException(new ExceptionErrorPage(e, responsePage));
      }
      else
      {
        // give up while we're ahead!
        throw new WicketRuntimeException("Internal Error: Could not render error page " +
View Full Code Here

      final boolean gatherExtInfo = parameters.getAsBoolean(PARAM_GATHER_EXTENDED_BROWSER_INFO, false);
      WebApplication.get().getRequestCycleSettings().setGatherExtendedBrowserInfo(gatherExtInfo);
      if (!gatherExtInfo) {
        // Redirect to same page and make sure the client enters in a new session.
        WebSession.get().invalidate();
        throw new RestartResponseException(//
            new RedirectPage(urlFor(DetectClientCapabilitiesPage.class, null)));
      }
    }
  }
View Full Code Here

    button = new Button("redirectToPageBtn") {
      private static final long serialVersionUID = 1L;
     
      @Override
      public void onSubmit() {
        throw new RestartResponseException(ToHomeDemoPage.class);
      }
    };
    form.add(button);
   
    button = new Button("redirectToPageWithInterceptionBtn") {
View Full Code Here

  {
    // logon successful. Continue to the original destination
    continueToOriginalDestination();

    // Ups, no original destination. Go to the home page
    throw new RestartResponseException(getApplication().getHomePage());
  }
View Full Code Here

    long ticketId = Long.parseLong(id);
    ticket = app().tickets().getTicket(repository, ticketId);

    if (ticket == null) {
      // ticket not found
      throw new RestartResponseException(TicketsPage.class, WicketUtils.newRepositoryParameter(repositoryName));
    }

    final List<Change> revisions = new ArrayList<Change>();
    List<Change> comments = new ArrayList<Change>();
    List<Change> statusChanges = new ArrayList<Change>();
View Full Code Here

    if (StringUtils.isEmpty(repositoryName)) {
      error(MessageFormat.format(getString("gb.repositoryNotSpecifiedFor"), getPageName()), true);
    }

    if (!getRepositoryModel().hasCommits) {
      throw new RestartResponseException(EmptyRepositoryPage.class, params);
    }

    if (getRepositoryModel().isCollectingGarbage) {
      error(MessageFormat.format(getString("gb.busyCollectingGarbage"), getRepositoryModel().name), true);
    }
View Full Code Here

  public ChangePasswordPage() {
    super();

    if (!GitBlitWebSession.get().isLoggedIn()) {
      // Change password requires a login
      throw new RestartResponseException(getApplication().getHomePage());
    }

    if (!app().settings().getBoolean(Keys.web.authenticateAdminPages, true)
        && !app().settings().getBoolean(Keys.web.authenticateViewPages, false)) {
      // no authentication enabled
      throw new RestartResponseException(getApplication().getHomePage());
    }

    UserModel user = GitBlitWebSession.get().getUser();
    if (!app().authentication().supportsCredentialChanges(user)) {
      error(MessageFormat.format(getString("gb.userServiceDoesNotPermitPasswordChanges"),
View Full Code Here

TOP

Related Classes of org.apache.wicket.RestartResponseException

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.