Request method 'POST' not supported | SPRING BOOT

0

I'm trying to mount a simple start menu and I get an error in the POST method when I press the submit button.

My controller with the post method called by the submit in html with value "login" My controller with the post method called by the submit in html with value "login"

My index.html

    
asked by Adrian Sanchez Martinez 15.02.2018 в 13:28
source

1 answer

0

Your class should go like this:

@RequestMapping(/usuario/**)

After your login you have to go:

@RequestMapping(value="login", method=RequestMethod.POST)

That's how you got the login.

As you have it, only one type url is waiting for you _

tuServidor/usuario

The rest discards it.

With the modifications that I say you can access as:

tuServidor:[8080]/usuario/login

The way you enter depends on how you have configured your server.

If you want to implement security I recommend you use the layer of spring security. It will make your life easier after you understand it.

    
answered by 05.03.2018 в 21:05