Hot republishing/deploying of static xhtml files issues
Asked Answered
D

1

2

I'm noticing a lot of issues operating the "hot deploying" of JSF pages in the following environment:

  1. Eclipse Indigo(latest version)
  2. Tomcat 5.5
  3. JSF 1.2
  4. Facelets View Handler

I noticed that, if I modify an already rendered xhtml page (for example the CSS style of an element) and then re-publish(through Eclipse or manually copying the xhtml file inside Tomcat) this page (maintaining the servlet container up), it doesn't show me the current changes.

I also, in vain, setup the following configuration on my web application:

<Context 
    docBase="mywebapp" 
    path="/mywebapp" 
    reloadable="true" 
    cachingAllowed="false">

My last tought is that the Restore-View Phase of a typical JSF page processing, does not check if the client-view (the xhtml page of course) has changed from the last time it has been loaded in the FacesContext.

If so, how can i force the building of a new UIViewRoot object for each submitted request??

I'm a lot frustrating in restarting the tomcat server for each change in jsf pages.

Thanks a lot for your support.

Deina answered 27/9, 2011 at 9:52 Comment(0)
S
9

Try adding the following to your web.xml config file:

  <context-param>
      <param-name>facelets.DEVELOPMENT</param-name>
      <param-value>true</param-value>
  </context-param>
  <context-param>
      <param-name>facelets.REFRESH_PERIOD</param-name>
      <param-value>1</param-value>
  </context-param>

It tells JSF to re-render the Facelet. See how I put "1". In a Prod environment you would always put "-1" to disable this feature, since the facelets shouldn't be changing in a Prod environment.

You also need to make sure you can Hot Deploy class and JSP resources. You can find how to do that here:

http://ducquoc.wordpress.com/2010/11/06/eclipse-wtp-tomcat-hot-deploy/

Sluggard answered 28/10, 2011 at 1:1 Comment(1)
Works great, thanks - Any thoughts on how to conditionally set this instead of hard-coding it into web.xml? (i.e. if server is localhost)???Steeve

© 2022 - 2024 — McMap. All rights reserved.