I have followed all the tutorials, but still I have a problem that I can't get an object from a form to the controller using Spring MVC. What might be the case? I am using Thymeleaf to format my jsp pages. <!DOCTYPE HTML> <html xmlns:th="http://www.thymeleaf.org"> <head> <title>Getting Started: Handing Form Submission</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <h1>Form</h1> ${priceIncrease.getMessage()} ddd <form action="" th:action="@{/increaseprice}" th:object="${priceIncrease}" method="post"> <input type="text" th:field="*{message}" /> <p><input type="submit" value="Submit" /> </form> </body> </html> package com.springapp.mvc; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import store.service.PriceIncrease; import org.apache.commons.logging.*; @Controller public class PriceIncreaseFormController{ protected final Log …

Member Avatar
+0 forum 0

I have followed all the tutorials, but still I have a problem that I can't get an object from a form to the controller using Spring MVC. What might be the case? I am using Thymeleaf to format my jsp pages. <!DOCTYPE HTML> <html xmlns:th="http://www.thymeleaf.org"> <head> <title>Getting Started: Handing Form Submission</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <h1>Form</h1> ${priceIncrease.getMessage()} ddd <form action="" th:action="@{/increaseprice}" th:object="${priceIncrease}" method="post"> <input type="text" th:field="*{message}" /> <p><input type="submit" value="Submit" /> </form> </body> </html> package com.springapp.mvc; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import store.service.PriceIncrease; import org.apache.commons.logging.*; @Controller public class PriceIncreaseFormController{ protected final Log …

Member Avatar
Member Avatar
+0 forum 1

The End.