You can use an ajax call to send your data to a controller.
HTML
<div>
<input name="wordCount" id="wordCount" type="text"/>
<input type="submit" name="start" value="Start" onclick="ajaxCall()"/>
</div>
JQuery와
function ajaxCall() {
var value = $('#wordCount').val();
$.ajax({
type : 'POST',
url : 'controller.htm',
data:{value:value},
success : function(data) {
alert('Success');
}
});
}
컨트롤러
@RequestMapping(value="/controller" ,method = RequestMethod.POST)
@ResponseBody
public String restructure(Model model, HttpSession session, HttpServletResponse response, final RedirectAttributes redirectAttributes,
@RequestParam(value = "value",required=false) String value){
System.out.println("Value from JSP "+ value);
}
희망이 있습니다.