I am using @RequestParam
to catch the front-end user input and pass it to the back end through controller and save it to the database.
So far controller handles the request like this:
@RequestMapping(value = "/myURL", method = RequestMethod.POST)
public String saveCustomer(
@RequestParam("customerFirstName") String customerFirstName,
@RequestParam("customerLastName") String customerLastName,) {
Customer customer = customerService.saveCustomer(
customerFirstName, customerLastName);
return null;
}
Well I guess this is fine when I only have two @RequestParam
for two arguements, but I am facing some table that has more than 10 params, I think by using @RequestParam is apparently not realistic, is there another around this?