留言板
JSP refresh bug
How do I refresh a jsp in my own portlet without having to restart the server?
What I mean is this. If I go into one of the liferay portlets under ROOT, and edit view.jsp, I can just hit F5 on the browser and see the change immediately.
I created my own portlet under webapps (with its own WEB-INF folder and web.xml). I based this off one of the other ones in the same directory. However, if I change view.jsp in this portlet, it does not refresh until I restart tomcat.
What I mean is this. If I go into one of the liferay portlets under ROOT, and edit view.jsp, I can just hit F5 on the browser and see the change immediately.
I created my own portlet under webapps (with its own WEB-INF folder and web.xml). I based this off one of the other ones in the same directory. However, if I change view.jsp in this portlet, it does not refresh until I restart tomcat.
I fixed my own problem. After searching these forums and trying the various fixes (even for older versions), I finally did some hacking (guessing) and found the simplest fix:
(1) Open:
C:\liferay-portal-5.2.2\tomcat-5.5.27\webapps\sample-test-portlet\META-INF\context.xml
(2) You should see these lines:
<Context
antiJARLocking="true"
antiResourceLocking="true"
/>
(3) Change antiResourceLocking to false:
<Context
antiJARLocking="true"
antiResourceLocking="false"
/>
(4) Save and restart liferay.
JSP pages should refresh (recompile) without having to bounce the server now.
I tried changing a bunch of other things in a bunch of other files based on advise from the forums and such, but after all was said and done, I basically wiped my local copy of the portlet, grabbed the original copy I saved earlier, set the value in context.xml and it worked!!!
I actually googled "antiResourceLocking" and found:
http://www.nabble.com/AntiResourceLocking-Side-Effect-td18618364.html
<<snip>>>
The side effect of setting this is that JSP's or in our case Velocity
templates are not reloaded. This
is a bit of pain for development, but is required for production on a
Windows server (I'm told).
<<snip>>
(1) Open:
C:\liferay-portal-5.2.2\tomcat-5.5.27\webapps\sample-test-portlet\META-INF\context.xml
(2) You should see these lines:
<Context
antiJARLocking="true"
antiResourceLocking="true"
/>
(3) Change antiResourceLocking to false:
<Context
antiJARLocking="true"
antiResourceLocking="false"
/>
(4) Save and restart liferay.
JSP pages should refresh (recompile) without having to bounce the server now.
I tried changing a bunch of other things in a bunch of other files based on advise from the forums and such, but after all was said and done, I basically wiped my local copy of the portlet, grabbed the original copy I saved earlier, set the value in context.xml and it worked!!!
I actually googled "antiResourceLocking" and found:
http://www.nabble.com/AntiResourceLocking-Side-Effect-td18618364.html
<<snip>>>
The side effect of setting this is that JSP's or in our case Velocity
templates are not reloaded. This
is a bit of pain for development, but is required for production on a
Windows server (I'm told).
<<snip>>