In this blog we will discuss how to deploy your static(views/css) changes at runtime. If you make some changes in your views(html, xhtml, jsp) or in cascading style sheet(css), you don't need to restart your app server to deploy these changes. You can use Ant to deploy the changes at runtime. I'm using Tomcat as the webserver and Eclipse as the IDE.
Define this xml file.
<project basedir="." default="deployView" name="Deploy">
<target name="deployView">
<copy todir="${basedir}/target/${application_context}" includeemptydirs="false">
<fileset dir="${basedir}/src/main/webapp" >
<include name="**/*.xhtml"/>
<include name="**/*.css"/>
</fileset>
</copy>
</target>
</project>
In Eclipse go to Windows->Show View->Ant.
In the Ant window right click and select 'Add Buildfiles...'. Select the above xml file. You will see 'Deploy' -> 'deployView'.
Whenever you want to deploy the changes in your views just double click on this.
No comments:
Post a Comment