Tabnine Logo
AccessDeniedHandlerImpl.setErrorPage
Code IndexAdd Tabnine to your IDE (free)

How to use
setErrorPage
method
in
org.springframework.security.web.access.AccessDeniedHandlerImpl

Best Java code snippets using org.springframework.security.web.access.AccessDeniedHandlerImpl.setErrorPage (Showing top 9 results out of 315)

origin: spring-projects/spring-security

/**
 * Shortcut to specify the {@link AccessDeniedHandler} to be used is a specific error
 * page
 *
 * @param accessDeniedUrl the URL to the access denied page (i.e. /errors/401)
 * @return the {@link ExceptionHandlingConfigurer} for further customization
 * @see AccessDeniedHandlerImpl
 * @see #accessDeniedHandler(org.springframework.security.web.access.AccessDeniedHandler)
 */
public ExceptionHandlingConfigurer<H> accessDeniedPage(String accessDeniedUrl) {
  AccessDeniedHandlerImpl accessDeniedHandler = new AccessDeniedHandlerImpl();
  accessDeniedHandler.setErrorPage(accessDeniedUrl);
  return accessDeniedHandler(accessDeniedHandler);
}
origin: spring-projects/spring-security-oauth

if (StringUtils.hasText(failurePage)) {
 AccessDeniedHandlerImpl failureHandler = new AccessDeniedHandlerImpl();
 failureHandler.setErrorPage(failurePage);
 consumerContextFilterBean.addPropertyValue("OAuthFailureHandler", failureHandler);
origin: geoserver/geoserver

  accessDeniedHandler.setErrorPage(authConfig.getAccessDeniedErrorPage());
else LOGGER.warning("Cannot find: " + authConfig.getAccessDeniedErrorPage());
origin: org.springframework.security/spring-security-config

/**
 * Shortcut to specify the {@link AccessDeniedHandler} to be used is a specific error
 * page
 *
 * @param accessDeniedUrl the URL to the access denied page (i.e. /errors/401)
 * @return the {@link ExceptionHandlingConfigurer} for further customization
 * @see AccessDeniedHandlerImpl
 * @see #accessDeniedHandler(org.springframework.security.web.access.AccessDeniedHandler)
 */
public ExceptionHandlingConfigurer<H> accessDeniedPage(String accessDeniedUrl) {
  AccessDeniedHandlerImpl accessDeniedHandler = new AccessDeniedHandlerImpl();
  accessDeniedHandler.setErrorPage(accessDeniedUrl);
  return accessDeniedHandler(accessDeniedHandler);
}
origin: org.springframework.security/spring-security-javaconfig

/**
 * Shortcut to specify the {@link AccessDeniedHandler} to be used is a specific error page
 *
 * @param accessDeniedUrl the URL to the access denied page (i.e. /errors/401)
 * @return the {@link ExceptionHandlingConfigurer} for further customization
 * @see AccessDeniedHandlerImpl
 * @see {@link #accessDeniedHandler(org.springframework.security.web.access.AccessDeniedHandler)}
 */
public ExceptionHandlingConfigurer<H> accessDeniedPage(String accessDeniedUrl) {
  AccessDeniedHandlerImpl accessDeniedHandler = new AccessDeniedHandlerImpl();
  accessDeniedHandler.setErrorPage(accessDeniedUrl);
  return accessDeniedHandler(accessDeniedHandler);
}
origin: apache/servicemix-bundles

/**
 * Shortcut to specify the {@link AccessDeniedHandler} to be used is a specific error
 * page
 *
 * @param accessDeniedUrl the URL to the access denied page (i.e. /errors/401)
 * @return the {@link ExceptionHandlingConfigurer} for further customization
 * @see AccessDeniedHandlerImpl
 * @see #accessDeniedHandler(org.springframework.security.web.access.AccessDeniedHandler)
 */
public ExceptionHandlingConfigurer<H> accessDeniedPage(String accessDeniedUrl) {
  AccessDeniedHandlerImpl accessDeniedHandler = new AccessDeniedHandlerImpl();
  accessDeniedHandler.setErrorPage(accessDeniedUrl);
  return accessDeniedHandler(accessDeniedHandler);
}
origin: stackoverflow.com

 public class MyAccessDeniedHandler implements AccessDeniedHandler {

  private AccessDeniedHandlerImpl accessDeniedHandlerImpl = new AccessDeniedHandlerImpl();

  public void handle(HttpServletRequest request, HttpServletResponse response,
      AccessDeniedException accessDeniedException) throws IOException, ServletException {

    //Some CSRF related code 

    // Then call accessDeniedHandlerImpl.handle to handle request
    accessDeniedHandlerImpl.handle(request, response, accessDeniedException);
  }

  /**
   * The error page to use. Must begin with a "/" and is interpreted relative to the current context root.
   *
   * @param errorPage the dispatcher path to display
   *
   * @throws IllegalArgumentException if the argument doesn't comply with the above limitations
   * @see AccessDeniedHandlerImpl#setErrorPage(String)
   */
  public void setErrorPage(String errorPage) {
    // You can set custom error page here 
    accessDeniedHandlerImpl.setErrorPage(errorPage);
  }
}
origin: socialsignin/spring-social-security

 = new AccessDeniedHandlerImpl();
request.setAttribute(REQUIRED_PROVIDERS_REQUEST_ATTRIBUTE_NAME, requiredProviderIds);
providerSpecificAccessDeniedHandler.setErrorPage(connectWithProviderUrlPrefix + "/" + requiredProviderIds.iterator().next());
providerSpecificAccessDeniedHandler.handle(request, response, accessDeniedException);
  defaultAccessDeniedHandler.setErrorPage(defaultAccessDeniedUrl);
  defaultAccessDeniedHandler.handle(request, response, accessDeniedException);
origin: stackoverflow.com

    new LoginUrlAuthenticationEntryPoint("/login"));
AccessDeniedHandlerImpl accessDeniedHandlerImpl = new AccessDeniedHandlerImpl();
accessDeniedHandlerImpl.setErrorPage("/exception");
exceptionTranslationFilter
    .setAccessDeniedHandler(accessDeniedHandlerImpl);
org.springframework.security.web.accessAccessDeniedHandlerImplsetErrorPage

Javadoc

The error page to use. Must begin with a "/" and is interpreted relative to the current context root.

Popular methods of AccessDeniedHandlerImpl

  • <init>
  • handle

Popular in Java

  • Making http requests using okhttp
  • getExternalFilesDir (Context)
  • startActivity (Activity)
  • compareTo (BigDecimal)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now