Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Resources - Javascript file strange behavior!!!

 
Cj Recto
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hellow guys, I'm having a problem regarding with my javascript files in my spring web project.

I wonder what's wrong with this, but my external javascript file doesn't reflect the changes I made to it when I run the program.
What I do is I need to rename the file so that the changes would take effect.

When I close eclipse and open it again, then the changes would not be reflect again. Then I need to rename the javascript file again.

It seemed that it retains the previous code it has everytime I close and open my eclipse.

I'm lost guys, have you experienced this problem?

Any help would be appreciated!

Thanks in advance!


heres the part of my dispatcher servlet


and here's my html file code :
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I may be misunderstanding but it sounds like to me that your browser is caching your javascript. Changing the name is forcing the browser to reload it.
 
Cj Recto
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, thanks for that answer, I think that's the problem, I'm currently working on it! Thanks!
 
Cj Recto
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thinks I found the solution, let me post it here just incase anyone would experience the same problem.

in your mvc resources configuration, set cache-period="0" so it will prevent resources files from being cached.

I found it here:

prevent spring mvc resources from being cached

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic