All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.smartcosmos.security.authentication.direct.DirectAccessDeniedHandler Maven / Gradle / Ivy

Go to download

Provides Spring Configuration and Annotations making it easier to develop SMART COSMOS Extensions

The newest version!
package net.smartcosmos.security.authentication.direct;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.web.access.AccessDeniedHandler;

/**
 * @author voor
 */
public class DirectAccessDeniedHandler implements AccessDeniedHandler {
    @Override
    public void handle(HttpServletRequest request, HttpServletResponse response,
            AccessDeniedException accessDeniedException)
                    throws IOException, ServletException {
        if (!response.isCommitted()) {
            response.sendError(HttpServletResponse.SC_FORBIDDEN,
                    accessDeniedException.getMessage());
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy