调用Controller方法的几种方式

1. 超链接调用

    ">${book.title}

@RequestMapping(value = "/book/detail/{bookId}")
public String details(@PathVariable("bookId") long bookId, Model model) {
	Book book = this.bookstoreService.findBook(bookId);
	model.addAttribute(book);
	return "book/detail";
}
2. JS调用
${tab.name }
function toGatherData(tableId) {
	var sel = document.getElementById("sel" + tableId);
	var period = sel[sel.selectedIndex].value;
	var url = WEB_PATH + "data/gather/gatherInterface.do?tableId=" + tableId
			+ "&period=" + period;
	//alert(url);
	openWindow(url, "gatherWin", null, null, 1);
}




你可能感兴趣的:(Note)