How to set a custom login processing page for spring security?
<p>i was having problem getting spring security to process the login from the controller i have defined in a class namely </p>

<pre><code>    @RequestMapping(value="/login", method=RequestMethod.POST)
</code></pre>

<p>I did some googling and found that spring takes the default login processng page as <code>/j_spring_security_check</code></p>

<p>So how can i make spring do the login processing from the controller i have defined.</p>

<p>I have this in my security.config file</p>

<pre><code>    @Override
protected void configure(HttpSecurity http) throws Exception {

     try {
        http
         .csrf().disable()
         .authorizeRequests()
         .antMatchers("/static/**").permitAll()
         .antMatchers("/settings/api/**").permitAll()
         .antMatchers("/api/**").permitAll()
         .anyRequest().authenticated()
         .and()
         .formLogin()
         .loginPage("/login").permitAll()

         .defaultSuccessUrl("/", true);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        System.out.println("sadhiasdniaaaaaaaaaaaaaaaa:");
        e.printStackTrace();
    }
}
</code></pre>

<p>i want spring to use this controller to process the login but it isn't using it </p>

<pre><code>    @RequestMapping(value="/login", method=RequestMethod.POST)
public String login(HttpServletRequest request, HttpServletResponse response) {
    System.out.println("\n\n\n*******hello11111111111111********      " + request.getSession().getAttribute("userLoginStatus"));
    String username = request.getParameter("username");
    String password = request.getParameter("password");
    boolean f = false;
    f = customAuthenticationProvider.verifyUser(username,password,request);
    if(f == false) 
        return "loginError";
    else
        return "index";
}
</code></pre>