0

我正在研究 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>

但它不起作用。你能指出如何纠正它吗?谢谢

4

1 回答 1

2

试试这个:

<button id="plotbtn" onclick = "myFunction('${model.research}')">plot</button>
于 2013-09-06T03:02:45.230 回答