You cannot directly call bootstrap modal to pop up using the controller. There you cannot bind the form using Spring. But you can achieve this with Ajax. You should use the form as a regular HTML form without using spring tags.
function searchAjax() { var data = {} data["query"] = $("#query").val(); $.ajax({ type : "POST", contentType : "application/json", url : "${home}search/api/getSearchResult", data : JSON.stringify(data), dataType : 'json', timeout : 100000, success : function(data) { console.log("SUCCESS: ", data); display(data); }, error : function(e) { console.log("ERROR: ", e); display(e); }, done : function(e) { console.log("DONE"); } }); }
This is an ajax example for you to get an idea. You must HttpServletRequest retrieve data from the controller. The above example is taken from http://www.mkyong.com/spring-mvc/spring-4-mvc-ajax-hello-world-example/
source share