I have the following code setting a variable in my controller:
model.set(\"type\", type);
In the thymeleaf view I want to construct a form
Exception evaluating SpringEL expression: "businessId" (login:50)
I have the same problem and solve via string concatination like below.
LoginController.java
@RequestMapping(value = "/login/{businessId}", method = RequestMethod.GET)
public ModelAndView get(HttpServletRequest request, @PathVariable String businessId) {
ModelAndView modelAndView = new ModelAndView("login");
modelAndView.addObject("businessId", businessId);
return modelAndView;
}
login.html