我在表单和控制器中使用了modelattribute。
<form:form action="/admin/editingBook" modelAttribute="editingBook">
...
...
</form:form>
控制器
@RequestMapping(method = RequestMethod.POST, value = "/admin/editingBook")
public String updateBook(@ModelAttribute BookBean bookBean) {
}
我想添加一些不在我的modelAttribute中的信息,比如
@RequestMapping(method = RequestMethod.POST, value = "/admin/editingBook")
public String updateBook(@ModelAttribute BookBean bookBean, @RequestParam("bookName") String bookName) {
}
不确定如何在jsp端和控制器端执行此操作
答案 0 :(得分:0)
书名会来吗?
控制器端:
@RequestMapping(method = RequestMethod.POST, value = "/admin/editingBook/{bookName}")
public String updateBook(@ModelAttribute BookBean bookBean, @RequestParam("bookName") String bookName) {
}