Example usage for javax.servlet.http HttpServletResponse sendError

List of usage examples for javax.servlet.http HttpServletResponse sendError

Introduction

In this page you can find the example usage for javax.servlet.http HttpServletResponse sendError.

Prototype

public void sendError(int sc, String msg) throws IOException;

Source Link

Document

Sends an error response to the client using the specified status and clears the buffer.

Usage

From source file:ru.codemine.ccms.api.security.ApiEntryPointHandler.java

@Override
public void commence(HttpServletRequest hsr, HttpServletResponse hsr1, AuthenticationException ae)
        throws IOException, ServletException {
    hsr1.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Access denied");
}

From source file:com.artivisi.spring.security.RestAuthenticationEntryPoint.java

@Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException ae)
        throws IOException, ServletException {
    response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized");
}

From source file:com.jevontech.wabl.security.EntryPointUnauthorizedHandler.java

@Override
public void commence(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse,
        AuthenticationException e) throws IOException, ServletException {
    httpServletResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Access Denied");
}

From source file:es.ucm.fdi.dalgs.rest.security.RestAuthenticationEntryPoint.java

@Override
public void commence(HttpServletRequest arg0, HttpServletResponse arg1, AuthenticationException arg2)
        throws IOException, ServletException {
    arg1.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized");

}

From source file:es.ucm.fdi.dalgs.rest.security.RestAuthenticationFailureHandler.java

@Override
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
        AuthenticationException exception) throws IOException, ServletException {
    response.sendError(HttpServletResponse.SC_UNAUTHORIZED, STATUS_MESSAGE_AUTHENTICATION_FAILED);
}

From source file:opensnap.security.NoOpAuthenticationFailureHandler.java

@Override
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
        AuthenticationException exception) throws IOException, ServletException {
    response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Authentication Failed: " + exception.getMessage());
}

From source file:de.knightsoftnet.validators.server.security.HttpAuthenticationEntryPoint.java

@Override
public void commence(final HttpServletRequest prequest, final HttpServletResponse presponse,
        final AuthenticationException pauthException) throws IOException {
    presponse.sendError(HttpServletResponse.SC_UNAUTHORIZED, pauthException.getMessage());
}

From source file:io.github.jhipster.security.AjaxAuthenticationFailureHandler.java

@Override
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
        AuthenticationException exception) throws IOException, ServletException {

    response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Authentication failed");
}

From source file:net.nan21.dnet.core.web.security.DefaultAccessDeniedHandler.java

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

    response.sendError(HttpServletResponse.SC_FORBIDDEN, "Not authenticated");

}

From source file:com.climate.oada.security.RestAuthenticationEntryPoint.java

@Override
public void commence(HttpServletRequest request, HttpServletResponse response,
        AuthenticationException authException) throws IOException {
    response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Unauthorized");
}