I have writen the Java code to send the excel to client side. I am calling servlet from java script when the user click on the button in the page. But the File is opening in the same browser. Instead how to open the file in excel format not inside the browser without save/close dialog?

Java Script While clicking on one button

```
 window.location = url+'?Data='+Math.random();

```

Java

```
String ramdonNumber =this.getHttpRequest().getParameter("Data");
        System.out.println("Inside Action"+ramdonNumber);
        File file = new File("C:/Documents and Settings/XXXXXX/Desktop/RevisedAvailableSeatForSRESR.xls");

        try {
            this.setFileInputStream(new FileInputStream(file));
        } catch (FileNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        HttpServletResponse response = this.getHttpResponse();
        response.setHeader("Content-Type", "application/vnd.ms-excel");
        response.setHeader("Content-Disposition",
                "inline;filename=\"" + file.getName() + ".xls\";");

```