Gerrie
Gerrie

Reputation: 3873

Tomcat myfaces dynamic source files

I'm going to try and make as much sense as possible here. We are working on a myfaces 2 app in tomcat. On our local dev machines, whenever we want to change one of our xhtml files, we have to stop the server, deploy and then start the server back up. This is cumbersome and makes making small changes to the view tedious. I tried changing the deployed xhtml file in tomcat, but the server only picks up the new change after a restart.

Is there any type of config in myfaces or tomcat I can do to force the rebuilding of these source xhtml's every time?

Upvotes: 1

Views: 1264

Answers (3)

fims
fims

Reputation: 9

I face the same problem with you, and i'm using eclipse and Tomcat Server, and then i try to change the tomcat configuration in Publishing option set to Automatically publish when resource change.

It works for me..

Upvotes: 0

Gerrie
Gerrie

Reputation: 3873

ok, after some more intensive googling, slaughtering and then burning the sacrficial lamb, doing the sacred developers dance and drinking the magic (java) potion I found the answer. If you want to know the answer, pay $500 into my paypal account....

....

ok seriously. You just need to add the following to your web.xml

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

It was that simple!

Upvotes: 4

Gursel Koca
Gursel Koca

Reputation: 21280

You should start tomcat server in debug mode. If you are using an IDE such as eclipse , it is straight forward.

Upvotes: 0

Related Questions