Question

Using the tomcat plugin "tomcat7-maven-plugin", I'm trying to get the "hot deploy" working with the embedded tomcat (using tomcat7:run).

I'm using a typical maven web app configuration under eclipse. From now, I can debug my java class and they are getting redeployed automatically on a code change

But my html and jsp don't get *re*deployed (${basedir}/src/main/webapp).

        <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <update>true</update>
                <contextReloadable>true</contextReloadable>
            </configuration>
        </plugin>

(I'm using the archetype "Thymeleaf Spring Maven Archetype").

Any idea how to get html and jsp redeployed on change ?

Était-ce utile?

La solution

I believe problem might be in the spring/thymeleaf config. Please make sure to disable thymeleaf templates caching in your spring configuration. See: Spring MVC with Thymeleaf. Update static data ( specifically the answer: https://stackoverflow.com/a/14659583/1581069)

In general, caching should be enabled for production only (sure, there might be exceptions, but...). On the other hand, in development people are interested in seeing the latest template updates in action.

UPDATE: After reading your question once again I'm getting confused, as you mentioned thymeleaf, but jsp as well. As far as I remember thymeleaf was doing html (as a jsp alternative). So is it thymeleaf you use, or jsp? Because I went for thymeleaf way only.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top