0
是否有可能從jquery函數調用控制器方法來重定向一些描述頁面?Spring 4 MVC + Apache Tiles 3 + JQuery
例如: 首先,我有這樣的描述瓷磚頁面是這樣的:
<definition name="IndexDefinitionTiles" extends="base.definition">
<put-attribute name="body" value="/WEB-INF/pages/_index.jsp" />
</definition>
其次,我有打電話說明瓷磚頁面這樣的方法控制:
@RequestMapping(value = "/goingPage", produces = {MediaType.APPLICATION_JSON_VALUE}, method = {RequestMethod.GET})
public @ResponseBody String goingPage(HttpServletRequest request) {
//This is a definition Tiles page.
return "IndexDefinitionTiles";
}
三,我有這個JQuery函數:
// Catch event on button.
$("#btnCallGoingMethod").click(function (evt) {
//Here i wanna call the method /goingPage that redirect to IndexDefinitionTiles
});
是嗎?可能?
我藉此機會問你是否可以用$ .ajax來做,我想知道它怎麼可能。
這可能嗎?有誰知道? – Roldan