1

I am writing a simple Spring MVC Controller with a few basic Request Mappings as follows.

@Controller
public class UserController {

    @RequestMapping("/showReg")
    public String showRegistration() {
        return "login/registerUser";        
    }

    @RequestMapping("/showReg1")
    public String showRegistration1() {
        return "login/registerUser";        
    }
}

Accessing localhost:8080/showReg gives the desired result.

But, localhost:8080/showReg1 is giving me 403 - Forbidden.

I am sure I am missing something very simple. What exactly is it? Kindly help me resolve the issue.

Sara
  • 603
  • 8
  • 19

1 Answers1

1

By default all the urls are secured in spring security.

Check your security config file. you might have opened the url from the security something like below.

For xml configuration :

<http pattern="/showReg" security="none"/>

OR java configuration :

@Override
public void configure(WebSecurity web) throws Exception {
     web.ignoring()
        .antMatchers("/showReg/**");
}
Alien
  • 15,141
  • 6
  • 37
  • 57