I'm a newbie in terms of Spring and Springboot and some aspects are still magic for me. Is it possible to pass automatically parameters to URL from a form on previous URL? The thing is:
I fill the form with username and password at localhost:8080/login-page
. E.g. johny123 / pass123.
Then i want it move to the URL adress localhost:8080/user=johny213
.
I've been looking for answers, and I don't think @RequestParam
solves the problem.
@PostMapping("/user={userId}")
public ModelAndView loginUser(@RequestParam ("userId") String userID, @ModelAttribute ("user") User user){
creating MAV, code code code, returning MAV
}
The thing is, I don't want to type parameters in URL, I want them to be automatically passed from a form. I haven't shown more code, because I just need a general idea and hints how to implement this.