I have a jsp page which is showing data in that page from DB.there is also a facility to show data in excel file.So there is a link to import the data in excel file.

I have noted down that url by pointing the cursor to that link that is also in the attached jpg file.Now i am hitting that url using url class but it will showing some jsp code,i think of that page in the ouput of java file.

But i want to save that data in excel file as it is occurring from GUI by clicking that icon.How can i save that file on the system by hitting that url.

SEE THE URL IN THE STATUS BAR OF ATTACHED JPG

Just implement the button or link to call your server side. Then use your server side to create the Excel file and stream it back to client.

Just implement the button or link to call your server side. Then use your server side to create the Excel file and stream it back to client.

you actually didn't get my point.my button or link is working fine.My front end is successfully getting excel file.what i want is running a java program that automatically click on that link so no one has to click manually.excel file is automatically downloaded to the system same as it is downloaded on click on that link in GUI.

I think you do not get my point... I am talking about streaming the excel-file binary data to client. It is not sending the HTTP response to display the excel data but rather for download.

Are you using a redirect on the server side when serving the excel file? How exactly is the download feature implemented? Also, what's the code you are using to download the excel file?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.