Interface RedirectRuleBuilder<R extends RequestContext<?>,W extends WebsocketContext<?>>

All Known Implementing Classes:
RedirectRuleBuilderDefault

public interface RedirectRuleBuilder<R extends RequestContext<?>,W extends WebsocketContext<?>>
Builder to create a redirection rule.
  • Method Details

    • permanently

      RedirectRuleBuilder<R,W> permanently()
      The redirection will be permanent (301).

      This is the default.

    • temporarily

      RedirectRuleBuilder<R,W> temporarily()
      The redirection will be temporarily (302).
    • to

      void to(String newPathOrFullUrl)
      The new path or full URL to redirect to.

      This ends the creation of the redirection rule and save it to the router.

    • to

      void to(RedirectHandler<R,W> handler)
      Will called the specified RedirectHandler to generate the path to redirect to.

      This ends the creation of the redirection rule and save it to the router.

    • pos

      RedirectRuleBuilder<R,W> pos(int position)
      The position where the filter will be run.

      By using a position below 0, the redirection will occures even if a main handler would be found.

      Defaults to -1000.