export to excel using displaytag causes the jsp to show old data
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   tashiwangdi
Posted On:   Tuesday, September 24, 2013 11:05 PM

I am using struts1. I am using the export option in the displaytag to export data to excel. I am having this problem where after I export the table data to excel, the jsp page shows the same data for other table entities also. For example, I have record of students. If I export student1 details to excel, the jsp shows the student1 data for other students. I have tried using the following to avoid caching of data:  response.setContentType("application/vnd.ms-excel"); response.setHeader("Content-Disposition", "attachment; filename=StdudentData.xls"); response.setHeader("Cache-Control","no-cache");  response.setHeader("Pragma","no-cache");   More>>

I am using struts1. I am using the export option in the displaytag to export data to excel. I am having this problem where after I export the table data to excel, the jsp page shows the same data for other table entities also. For example, I have record of students. If I export student1 details to excel, the jsp shows the student1 data for other students. I have tried using the following to avoid caching of data: 

response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment; filename=StdudentData.xls");
response.setHeader("Cache-Control","no-cache"); 
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", -1);

But the excel export throws error. If I remove the above , then the export works but the jsp again shows old student data. Appreciate your help.
Regards
.

tashi    <<Less
About | Sitemap | Contact