Mam formularz w Bootstrap Modal i chcę, aby mój kontroler Spring MVC tego słuchał. Mój problem polega na tym, że modal nie generuje href, ponieważ znajduje się on w aktualnej stronie, więc nie mogę zmapować tylko modala w moim kontroleru Spring MVC.Jak mapować Bootstrap Modal na Spring MVC controller
Potrzebuję go, ponieważ chcę pokazać błędy z obiektu bindingresult. Jak mogę to zrobić?
To jest mój modal: http://www.bootply.com/zerZIYpNAF Powiedzmy, że znajduje się on w index.jsp, więc urojoną ścieżką będzie /index#myModal.jsp lub coś w tym stylu.
@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;
}