#Problem with passing values from a form to Thymeleaf using Spring Boot

3 messages · Page 1 of 1 (latest)

spiral dove
#

Hello community!!!

I have a problem with passing values from a form to Thymeleaf using Spring Boot. I have a table with pizzas, and I am trying to pass the selected quantity and size values when adding a pizza to the cart. However, when submitting the form, instead of the expected pizzaId (id) value, the pizzaId (id, id, id, id, id, id) field inserts a comma separated list of values.

Below I have attached screenshots of my structure in HTML and the controller method in Spring Boot

I'm guessing the problem may be related to how I'm using the Thymeleaf loop to display the pizzas, and the fact that I have a form inside the body of the table.

Any help or hints on how to fix this problem would be appreciated. Thanks!!!

clear raftBOT
#

This post has been reserved for your question.

Hey @spiral dove! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.