Are you using spring or springBoot?
When it comes to the controllers, you need two of them
First create a home controller, that one is being called when you go to localhost:portnumber or anny of the other mapped urls:
Then make your registrationcontrolle, you're trying to use a ModdelAttribute, but you didn't prepared a model in the getMethod:
But for next time it would be helpfull if you included a bit more information, for example if you're not using springBoot, include your xml configuration.
Including your User.Class would also be helpfull, you need to provide setters for your instance variables otherwise the binding will fail
I also see you have an implementation of your repository, that not autowired, so I guess ( I shouldn't have to guess, you should tell me) you're using jdbc?What kinda seems weird to me?
Why not use Spring Data Jpa?
It's good to be able to use someting, it's better to understand how it works.