I\'m adding an object to my ModelAndView
in spring and forwarding to my jsp view. I need to access that object in my jquery. Is this possible without first puttin
probably, you can save the model attribute in a hidden field and access it onload as below.
$(document).ready(function(){
var modelAttr = $("#modelAttr").val();
alert(modelAttr);
}
input type="hidden" id="modelAttr" name="modelAttr" value="${modelAttribute}"/>
Add c:out around the ${modelAttribute}
in the jsp.