Package org.pac4j.core.util
Class HttpActionHelper
- java.lang.Object
-
- org.pac4j.core.util.HttpActionHelper
-
public final class HttpActionHelper extends java.lang.Object
Helper to build the appropriateHttpAction
.- Since:
- 4.0.0
- Author:
- Jerome LELEU
-
-
Constructor Summary
Constructors Constructor Description HttpActionHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
buildFormPostContent(WebContext context)
Build a form POST content from the web context.static RedirectionAction
buildFormPostContentAction(WebContext context, java.lang.String content)
Build the appropriate redirection action for a content which is a form post.static RedirectionAction
buildRedirectUrlAction(WebContext context, java.lang.String location)
Build the appropriate redirection action for a location.static HttpAction
buildUnauthenticatedAction(WebContext context)
Build the action for unauthenticated users.protected static java.lang.String
escapeHtml(java.lang.String s)
static boolean
isAlwaysUse401ForUnauthenticated()
static boolean
isUseModernHttpCodes()
static void
setAlwaysUse401ForUnauthenticated(boolean alwaysUse401ForUnauthenticated)
static void
setUseModernHttpCodes(boolean useModernHttpCodes)
-
-
-
Method Detail
-
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, java.lang.String location)
Build the appropriate redirection action for a location.- Parameters:
context
- the web contextlocation
- the location- Returns:
- the appropriate redirection action
-
buildFormPostContentAction
public static RedirectionAction buildFormPostContentAction(WebContext context, java.lang.String content)
Build the appropriate redirection action for a content which is a form post.- Parameters:
context
- the web contextcontent
- the content- Returns:
- the appropriate redirection action
-
buildFormPostContent
public static java.lang.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 java.lang.String escapeHtml(java.lang.String s)
-
isUseModernHttpCodes
public static boolean isUseModernHttpCodes()
-
setUseModernHttpCodes
public static void setUseModernHttpCodes(boolean useModernHttpCodes)
-
isAlwaysUse401ForUnauthenticated
public static boolean isAlwaysUse401ForUnauthenticated()
-
setAlwaysUse401ForUnauthenticated
public static void setAlwaysUse401ForUnauthenticated(boolean alwaysUse401ForUnauthenticated)
-
-