留言板

JSP refresh bug

Richard Sandoz,修改在14 年前。

JSP refresh bug

New Member 帖子: 2 加入日期: 09-4-23 最近的帖子
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.
Richard Sandoz,修改在14 年前。

RE: JSP refresh bug

New Member 帖子: 2 加入日期: 09-4-23 最近的帖子
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>>
Alexandru Georgescu,修改在14 年前。

RE: JSP refresh bug

New Member 帖子: 3 加入日期: 10-4-1 最近的帖子
Hi

There is another solution here:

http://blog.ropardo.ro/2010/04/01/deploying-modified-portlet-jsps-in-liferay-without-restarting/
thumbnail
David García González,修改在12 年前。

RE: JSP refresh bug

Regular Member 帖子: 127 加入日期: 09-7-14 最近的帖子
But why is it working this way?? I don't understand, is it only in 6.0.x versions?

And is it possible to change this?
Thanks!