我正在研究 Spring MVC。对JSP的了解非常有限......
我的控制器:
public ModelAndView handleRequest(HttpServletRequest request) {
ModelAndView mv = new ModelAndView("investigate");
mv.addObject("model", Model);
return mv;
}
我的模型:
public class Model {
public String research = "research";
public String getResearch() {
return research;
}
public void setResearch(String research) {
this.research = research;
}
}
我的观点:
<button id="plotbtn" onclick = "myFunction(${model.research})">plot</button>
但它不起作用。你能指出如何纠正它吗?谢谢