Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Having problem in exporting data while using "Display Tag" from sourceforge.net

Posted on 2006-04-12
4
Medium Priority
?
428 Views
Last Modified: 2010-04-01
Hi I am trying to use display tag in my JSP file. The tag shows the data perfectly fine. But when I click on the export options to export the data in excel or pdf it opens the appropriate application but no data is transferred. I have also included the filter in my web.xml file but still it is not working.
0
Comment
Question by:royalcyber
  • 2
4 Comments
 
LVL 2

Expert Comment

by:borislavmarkov
ID: 16438754
specify the header field Content-Length.
Sometimes Internet Explorer makes the query to your URL twice, take any actions if you depend on that.

Your servlet that returns data should look like:

ServletContext ctx = this.getServletContext();
mime = ctx.getMimeType(fileName);
aResponse.setContentType(mime);
OutputStream out = aResponse.getOutputStream();
aResponse.setContentLength( (int)lengthOfFile );
aResponse.setHeader("Pragma", "no-cache"); //HTTP 1.0
aResponse.setDateHeader("Expires", 1); //prevents caching at the proxy server
aResponse.setHeader("Cache-Control", "max-age=0");

//WRITE DATA
out.write(buf,0,bytes);
....

out.flush();
0
 

Author Comment

by:royalcyber
ID: 16439424
I am actually using pre-made "display tag" from sourceforge.net.
I insatalled the .jar files and .tld files as needed and am just passing an arraylist to these tag in JSP and they display
the daata in a table and give options such as sorting or export data to excel, xml etc.

I am not sure how to check teh code for this tag

Please help
0
 
LVL 23

Accepted Solution

by:
Siva Prasanna Kumar earned 2000 total points
ID: 16442105
http://displaytag.sourceforge.net/10/export_filter.html

I think you might have checke this link already any way just try out that page buffer tag in th solution it may solve your problem and also make sure that all your configurations are correct.

Thankyou.
0
 
LVL 2

Expert Comment

by:borislavmarkov
ID: 16443112
Anyway what is the URL on this link that is problematic, can you copy paste it so we can analyze it?
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What happened when I tried to make my phone, a Samsung Galaxy S8, stop dropping all WiFi signals was a saga I won't repeat here, but what you might want to know is how it started and how I got it working again.
Are you a startup company? Being a startup, you may be using shared hosting, or maybe even dedicated hosting. But have you ever given a thought to using cloud computing now? Yes, don’t be surprised, it is possible for startups to opt for cloud compu…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question