我有 .jsp 页面:index.jsp,它具有带链接的形式:
<form name="firstForm" method="get" action="list.form">
//-//-//
<a href = "removeFromStorage?id=<%=index %>">Remove from storage</a>
//-//-//
</form>
我有我的控制器:
@Controller
@RequestMapping(value = "/removeFromStorage")
public class MyController {
@RequestMapping(value = "/removeFromStorage", method = RequestMethod.GET)
public String test(@RequestParam("name") String name, ModelMap model){
//must get index of order, that must delete
//int index_remove = new Integer(req.getParameter("index"));
return "index";//request.getRequestDispatcher("hello.jsp").forward(req,res);
}
}
如何将控制器 (MyController) 映射到 url (removeFromStorage)?
我在 MyController 的注释中写了什么来处理 .jsp-page 中的 url=removeFromStorage?