I need to call a Controller on Spring framework whose content-type is "application/forcedownload" from a javascript function.
I could successfully call it from an Ajax call but do not understand why Servlet was not popping up the file(there were no exceptions).

Could you please tell me how can I achieve the same; Can it be done the way I am doing it or how can I call the controller directly from javascript function