Answers for "GlobalExceptionHandlerController is NOT visible to spring boot\]"

0

spring security controlleradvice

@Component("restAuthenticationEntryPoint")
public class RestAuthenticationEntryPoint implements AuthenticationEntryPoint{

    public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authenticationException) throws IOException, ServletException {

        response.setContentType("application/json");
        response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
        response.getOutputStream().println("{ \"error\": \"" + authenticationException.getMessage() + "\" }");

    }
}
Posted by: Guest on May-30-2020

Code answers related to "GlobalExceptionHandlerController is NOT visible to spring boot\]"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language