I am new to spring mvc but I would like to know how I can access the data that the user inputs in a form.
these are some code snippets:
My controller
@Override
protected Object formBackingObject(HttpServletRequest request) throws Exception {
return new A();
}
where A is the class containing the 'model' that the form should return.
My view
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<form:form>
<table>
<tr>
<td><form:label path="amount">Amount:</form:label></td>
<td><form:input path="amount"/></td>
<td><form:errors path="amount"/></td>
</tr>
... some more fields
<tr>
<td><form:label path="message">Message:</form:label></td>
<td><form:input path="message"/></td>
<td><form:errors path="message"/></td>
</tr>
<tr>
<td colspan=3 align=right>
<button type="submit">Transfer</button>
</td>
</tr>
</table>
</form:form>
Q: How and where can I access the amount and message field in my controller to perform some action with the data? (perhaps after validating).