Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Modified PDF won't refresh inside Brower control(A modified PDF resource will not refresh in a Browser control)
Modified PDF won't refresh inside Brower control [message #1456448] Thu, 30 October 2014 11:23 Go to next message
John Gymer is currently offline John GymerFriend
Messages: 261
Registered: November 2012
Location: UK
Senior Member
We use PDFBox library to create PDF files within our RAP application, but if I overwrite a PDF file, it does not get refreshed in any Browser control that points to it. It doesn't seem to matter what I do with the Browser control - I can even dispose it and recreate it, but pointing the new Browser to that same URL does not pick up the new modified PDF - it must cache the original one somewhere.

The only way to get a refreshed view is to start a brand new session in RAP.

How are RWT-Resources cached? Is there a way to force RAP to notice the changed file and reload?

It is not a browser issue - the same behaviour occurs on Firefox, Chrome and IE, and even on Firefox where there is an option to reload frame, it still uses the cached version.

Whose cache is it? I don't believe it is the browser - the behaviour indicates a RAP/RWT cache. Perhaps it is cached at the time when the RWT-Resource is registered?

Thanks, John


---
Just because you can doesn't mean you should
Re: Modified PDF won't refresh inside Brower control [message #1456462 is a reply to message #1456448] Thu, 30 October 2014 11:44 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2334
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi John,
did you try to create the new PDF file with a different name? How do you
register the created PDF? Are you using custom service handler to
deliver the PDF to the end user?
Best,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Modified PDF won't refresh inside Brower control [message #1456478 is a reply to message #1456448] Thu, 30 October 2014 12:01 Go to previous messageGo to next message
Roland Welker is currently offline Roland WelkerFriend
Messages: 11
Registered: October 2013
Junior Member
If it does not interfere with the way you retrieve the PDF, have you tried to add a fake request parameter that contains a time stamp?
Re: Modified PDF won't refresh inside Brower control [message #1456605 is a reply to message #1456478] Thu, 30 October 2014 14:31 Go to previous message
John Gymer is currently offline John GymerFriend
Messages: 261
Registered: November 2012
Location: UK
Senior Member
Thanks Ivan and Roland for your comments... they got me thinking...
I'm using ResourceManager.register(<filename>, <stream>) to register the PDF file as rwt-resource, but I assumed that the resource simply pointed to the physical file, but it appears not. The RWT resource is cached at the time the register is done, so if the physical file changes after that time, the resource will never know about it.
I also made an (incorrect) assumption that you didn't need to re-register a modified file on that basis, but I've changed this now, so that every time I re-create the PDF file, I register it again, with the same name through the ResourceManager, and now the modified PDF is picked up OK.

So, that was my misunderstanding of how RWT resources worked, and when they are cached.

If you change the file, re-register it!

All works now thanks guys!
John


---
Just because you can doesn't mean you should
Previous Topic:Swingwt on RAP
Next Topic:Cool new feature: multiple tab support. How do I turn it off?
Goto Forum:
  


Current Time: Fri Feb 21 17:16:29 GMT 2020

Powered by FUDForum. Page generated in 0.02609 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top