Reputation: 644
I'm working on Spring MVC. Have very limited knowledge in JSP...
My controller:
public ModelAndView handleRequest(HttpServletRequest request) {
ModelAndView mv = new ModelAndView("investigate");
mv.addObject("model", Model);
return mv;
}
My Model:
public class Model {
public String research = "research";
public String getResearch() {
return research;
}
public void setResearch(String research) {
this.research = research;
}
}
My view:
<button id="plotbtn" onclick = "myFunction(${model.research})">plot</button>
but it's not working. Can you point out how to correct it? Thanks
Upvotes: 0
Views: 2584
Reputation: 11579
Try this:
<button id="plotbtn" onclick = "myFunction('${model.research}')">plot</button>
Upvotes: 2