SpringMVC進行請求轉發

 java代碼中:

@RequestMapping("/aaa")
public String aaa(HttpServletRequest request, HttpServletResponse response) throws Exception {

	// 轉發到bbb.do中
	return "forward:bbb.do?a=" + "參數值";
}

@RequestMapping("/bbb")
public String bbb(HttpServletRequest request, HttpServletResponse response) throws Exception {

	// 執行代碼
	// String a = request.getParameter("a");
}

js代碼中的頁面跳轉

window.location.href="url/bbb.do?a="+'參數值';

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章