Static contents such as HTML, CSS, JavaScript changes does not effect on page refresh. It needs a server - restart for the changes to apply. But interestingly, only for the first two times the changes are applied on page reload. But from the third time change, the changes are not seen, only the second time changed content can be seen. The contents are present in war folder. What do i need to change in the standlone.xml ? I tried "static-content" and added a handler as mentioned in the jboss forum, but it doesnot seem to be working. Kindly let me know if further information needed.
You need to enable auto deployment of exploded content. The option is available in standalone.xml
configuration file as auto-deploy-exploded
attribute of deployment-scanner
element:
<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" auto-deploy-zipped="true" auto-deploy-exploded="true"/>
</subsystem>
To successfully achieve this, do the following:
Please be warned (and server will warn you too) that this is unstable behavior, IMHO unsuitable for production environment.
You could also use custom handler for specific path, see configuration below (unrelated parts were omitted). This way you don't have to redeploy on every change.
<subsystem xmlns="urn:jboss:domain:undertow:1.2">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http"/>
<host name="default-host" alias="jboss.local">
<location name="/" handler="welcome-content"/>
<location name="/static" handler="static"/>
</host>
</server>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
<file name="static" path="/Users/miso/static-files" directory-listing="false"/>
</handlers>
</subsystem>