aspose file tools*
The moose likes Other Java Products and Servers and the fly likes Jasper Report in Struts JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "Jasper Report in Struts JSP" Watch "Jasper Report in Struts JSP" New topic
Author

Jasper Report in Struts JSP

sandeep lokhande
Ranch Hand

Joined: Jan 25, 2010
Posts: 118

Hi Bilal,
I am using Jasper report in my struts project and creating some line graph as a report,
exported as HTML file and then included in a JSP file,
For first time report is visible ,
But the next time when i create another report and goes to the same page,

The image from previous report is there instead of new image for new Report,

After refreshing the page it shows exact correct output,

i thought its problem of repeatedly same request is send,
so I have appended some random number along with the request,
but it wont work,
This is how i included the file,



what may be the reason? please help.
Thank you in advance,

And best luck for your Book, i m looking forward to learn more about jasper report.




Thanks and Regards,
Sandeep Lokhande.
Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 759
try to clear the client cache.

include below line on top,in your jsp.



Jigar Naik


sandeep lokhande
Ranch Hand

Joined: Jan 25, 2010
Posts: 118

Jigar Naik wrote:try to clear the client cache.

include below line on top,in your jsp.



Yes sir,
I can see we are clearing cache but it still not working, do we have any other possibility?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Moving to JSP; this is not related to JasperReports.

That's a static include; try a dynamic include.

http://java.sun.com/products/jsp/tags/11/syntaxref117.html
bilal sidiqui
Author
Greenhorn

Joined: Aug 09, 2010
Posts: 17
Hi Sandeep,

You are including HTML representation of the jasper report directly into your jsp file. The HTML file in turn always uses images. I guess the problem is due to the cache either on the browser or on the Web server. That’s because two things (the HTML file and accompanying images) are being cached.

So try to fetch the actual HTML code from JasperReprots library and dynamically embed that code instead of including the HTML file. In addition, you may have to develop JSP logic to include some random number in the names of image files.

Bilal Siddiqui, Author of JasperReports 3.6.0 Development Cookbook
sandeep lokhande
Ranch Hand

Joined: Jan 25, 2010
Posts: 118

bilal sidiqui wrote:Hi Sandeep,

You are including HTML representation of the jasper report directly into your JSP file. The HTML file in turn always uses images. I guess the problem is due to the cache either on the browser or on the Web server. That’s because two things (the HTML file and accompanying images) are being cached.

So try to fetch the actual HTML code from JasperReprots library and dynamically embed that code instead of including the HTML file. In addition, you may have to develop JSP logic to include some random number in the names of image files.

Thank you for your response sir,
but before you could answer the question,

I have made that problem solved by changing HTML page path, by adding report in some separate folder that contains timestamp,
Thus forming unique path each request and browser wont cache it,
and also try and remove caching by response.setHeader("Cache-Control","no-cache");
Its working fine,
and delivered also.
I respond to thread after problem solving, because some other person on the earth could find the solution for the same problem

Your idea of including some random number in the names of image files can also serve the purpose,

Thank you very much for your reply once again,
and i am looking forward to learn more from your new Book.
Have a Great Time here.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jasper Report in Struts JSP