Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Richard Sandoz
JSP refresh bug
July 2, 2009 12:23 PM
Answer

Richard Sandoz

Rank: New Member

Posts: 2

Join Date: April 22, 2009

Recent Posts

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
RE: JSP refresh bug
July 2, 2009 4:44 PM
Answer

Richard Sandoz

Rank: New Member

Posts: 2

Join Date: April 22, 2009

Recent Posts

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
RE: JSP refresh bug
April 1, 2010 2:11 AM
Answer

Alexandru Georgescu

Rank: New Member

Posts: 3

Join Date: April 1, 2010

Recent Posts

Hi

There is another solution here:

http://blog.ropardo.ro/2010/04/01/deploying-modified-portlet-jsps-in-liferay-without-restarting/
David García González
RE: JSP refresh bug
December 16, 2011 4:24 AM
Answer

David García González

Rank: Regular Member

Posts: 127

Join Date: July 14, 2009

Recent Posts

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!