我想通过以下方式向控制器发送 3 个参数:
<li><a href="result?name1=thor&name2=hulk&name3=loki">SMTH</a></li>
控制器:
@Controller
@RequestMapping(value="/result")
public class SmthController {
@RequestMapping(method=RequestMethod.GET)
public String dosmth(HttpServletRequest request) {
String one = request.getParameter("name1");
String two = request.getParameter("name2");
String three = request.getParameter("name3");
JOptionPane.showMessageDialog(null,
" Param 1 is:" +one +" \n Param 2 is: " +two +" \n Param 3 is: " +three);
return "redirect:/";
}
}