我在Bootstrap Modal中有一个窗体,我希望我的Spring MVC控制器能够听到这个窗体。我的问题是模式不生成href,因为它在当前页面内,所以我不能在我的Spring MVC控制器中映射模式。如何将Bootstrap Modal映射到Spring MVC控制器
我需要它,因为我想从bindingresult对象中显示错误。我怎样才能做到这一点?
这是我的模态:http://www.bootply.com/zerZIYpNAF假设它位于index.jsp中,所以假想路径将是/index#myModal.jsp或类似的东西。
@RequestMapping(value="/send", method = RequestMethod.GET)
public String get(Dummybean bean){
return "??"; //index#myModal
}
@RequestMapping(value="/send", method = RequestMethod.POST)
public String post(@Valid @ModelAttribute("dummy") DummyBean bean, BindingResult bindingResult){
if(bindingResult.hasErrors()){
return "??"; //index#myModal
}
//do something
}
public class DummyBean{
@NotNull
private String name;
public String getName() {
return username;
}
public void setName(String name) {
this.name = name;
}