Class HttpActionHelper

java.lang.Object
org.pac4j.core.util.HttpActionHelper

public final class HttpActionHelper extends Object
Helper to build the appropriate HttpAction.
Since:
4.0.0
Author:
Jerome LELEU
  • Constructor Details

    • HttpActionHelper

      public HttpActionHelper()
  • Method Details

    • buildUnauthenticatedAction

      public static HttpAction buildUnauthenticatedAction(WebContext context)
      Build the action for unauthenticated users.
      Parameters:
      context - the web context
      Returns:
      the appropriate HTTP action
    • buildRedirectUrlAction

      public static RedirectionAction buildRedirectUrlAction(WebContext context, String location)
      Build the appropriate redirection action for a location.
      Parameters:
      context - the web context
      location - the location
      Returns:
      the appropriate redirection action
    • buildFormPostContentAction

      public static RedirectionAction buildFormPostContentAction(WebContext context, String content)
      Build the appropriate redirection action for a content which is a form post.
      Parameters:
      context - the web context
      content - the content
      Returns:
      the appropriate redirection action
    • buildFormPostContent

      public static String buildFormPostContent(WebContext context)
      Build a form POST content from the web context.
      Parameters:
      context - the web context
      Returns:
      the form POST content
    • escapeHtml

      protected static String escapeHtml(String s)

      escapeHtml.

      Parameters:
      s - a String object
      Returns:
      a String object
    • isUseModernHttpCodes

      public static boolean isUseModernHttpCodes()

      isUseModernHttpCodes.

      Returns:
      a boolean
    • setUseModernHttpCodes

      public static void setUseModernHttpCodes(boolean useModernHttpCodes)

      Setter for the field useModernHttpCodes.

      Parameters:
      useModernHttpCodes - a boolean
    • isAlwaysUse401ForUnauthenticated

      public static boolean isAlwaysUse401ForUnauthenticated()

      isAlwaysUse401ForUnauthenticated.

      Returns:
      a boolean
    • setAlwaysUse401ForUnauthenticated

      public static void setAlwaysUse401ForUnauthenticated(boolean alwaysUse401ForUnauthenticated)

      Setter for the field alwaysUse401ForUnauthenticated.

      Parameters:
      alwaysUse401ForUnauthenticated - a boolean