JSP:
<form:form commandName="editWeather" method="post" action="../edit">
<!-- Input fields -->
<input type="submit" value="Submit">
</form:form>
这就是我在 Spring 中获取模型的方式:
@ModelAttribute("DONTGIVEADAMN") Weather weather
而且我仍然可以使用weather
来进行操作,并且效果很好,例如:
weatherService.editWeather(weather);
我的问题是……为什么这行得通?