Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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() + "" }");

    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: android studio how to call api 
Java :: java convert int to string 
Java :: java string class 
Java :: string comparison using == in java 
Java :: long in java 
Java :: Load array of strings from console 
Java :: how to get the content og a bottongroup in java 
Java :: android java how to stop users fromgoing back too much 
Java :: java loop find index 
Java :: Java public no-arg constructor 
Java :: reading 2d array in java 
Java :: assign a random number in a set without replacement javva 
Java :: from which android version onwards cardelevation supports? 
Java :: intergers are appearing as string in Json 
Java :: Marging ViewPager 
Java :: java komplettes array ausgeben 
Java :: Demo Example 
Java :: java load configuration log 
Java :: managa firebase users 
Java :: java try-with-resources nested streams 
Java :: how to add a singleton hashset in java 
Java :: data validation dialog box android 
Java :: do i have to import files from the same package in java 
Java :: android int color = ContextCompat.getColor(getContext(), mColorResourceId); 
Java :: mapToJsonString 
Java :: Java Advantages of Anonymous Classes 
Java :: what is xml file in java 
Java :: aabb collision java 
Java :: how to add 0 in left padding using regular expression java 
Java :: java see you next happy year 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =