Eclipse - Dynamic Web Project not picking up chang

2019-07-23 05:21发布

问题:

I am using Run As -> Run on server, to run my web project on the local tomcat instance.

Problem is, when I make changes on JSP's and other project component, sometimes Eclipse picks this changes up, sometimes is does not. It seems kind of random...

回答1:

This could be due to various reasons, and cannot give a solid answer to it without knowing the exact cause. But, there are few things that could lead to this.

  • Check your Build Automatically setting (Project -> Build Automatically). This has to be enabled to publish your changes.
  • Under Server definition, check the Publishing settings. If it is none, then nothing will be published. If you have set a publishing interval, then you have to wait till that time is elapsed to get your copy synchronized with server.
  • If it is only related to JSP / JS, your browser cache could be giving you an old copy. Try clearing out your cache.


回答2:

I was also getting the same issue. I tried clearing cache which worked sometimes but this was painstaking because, for the JS or CSS changes, this was taking more time.

I found an alternative solution (which worked best as I didn't have to clear the cache again and again)

Add the below properties in the portal-ext.properties for JS and CSS refresh issue:

layout.template.cache.enabled=false
theme.css.fast.load=false
javascript.fast.load=false
minifier.enabled=false
com.liferay.portal.servlet.filters.minifier.MinifierFilter=false
include-and-override=portal-developer.properties

This should work like charm.

You can get more details in the below link:

https://community.liferay.com/forums/-/message_boards/message/3734062



回答3:

Also when talking css under Liferay/Tomcat you might try deleting your server cache, e.g. %catalina_home%/temp ?? (I just delete everything underneath). Tomcat may also cache jsp files which can cause problems files if you're attempting to update them dynamically. I typically delete the catalina work directory in that case. I hope that may help someone.