Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.3, 1.4-M1
    • Fix Version/s: 1.3.4, 1.4-M2
    • Component/s: wicket
    • Labels:
      None

      Description

      We have exceptions that restart a response and go to a different page, or to an intercept page. But we can't redirect to an external site.

      public class RedirectToExternalException extends AbstractRestartResponseException
      {
      private static final long serialVersionUID = 1L;

      public RedirectToExternalException(String url)
      {
      RequestCycle rc = RequestCycle.get();
      if (rc == null)

      { throw new IllegalStateException( "This exception can only be thrown from within request processing cycle"); }

      else
      {
      Response r = rc.getResponse();
      if (!(r instanceof WebResponse))

      { throw new IllegalStateException( "This exception can only be thrown when wicket is processing an http request"); }

      // abort any further response processing
      rc.setRequestTarget(new RedirectRequestTarget(url));
      }
      }
      }

        Activity

        Hide
        Johan Compagner added a comment -

        named it RedirectToUrlException because it doesnt really have to be external url it can also be in internal none wicket url. But an url it will be.

        Show
        Johan Compagner added a comment - named it RedirectToUrlException because it doesnt really have to be external url it can also be in internal none wicket url. But an url it will be.
        Johan Compagner made changes -
        Field Original Value New Value
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Johan Compagner [ jcompagner ]
        Johan Compagner committed 655115 (1 file)
        Martijn Dashorst created issue -

          People

          • Assignee:
            Johan Compagner
            Reporter:
            Martijn Dashorst
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development