I'm trying to excel export from popup window(jquery UI Dialog).I have java class method with response type content-disposition attachment header.But its not downloading the excel sheet.
jQuery("#dialog-form").dialog ({
autoOpen: false,
height: 600,
width: 700,
modal: true,
resizable: false,
draggable: false,
buttons : {
"Export" : function() {
jQuery.ajax({
url : '<s:url action="list" method="export"/>',
});
} });
Java class :
public String export(){
--some backend calls.
httpServletResponse.setHeader("Content-disposition",
"attachment; filename="+filename+".xls");
ServletOutputStream outputStream = httpServletResponse.getOutputStream();
outputStream.flush();
return null;
}
Console :
No result returned for action at null
Please advise why is this excel download is not working ?