How do I reload dynamically my jsp from an EAR ?

Deploy your JSP as part of an application deployed in exploded format. (That is create a folder named yourapplication.ear’  and inside it create a folder yourwebapplication.war).
This is the suggested deployment’ strategy when you’re developing your applications because changes to the JSP pages take effect immediately. Therefore, you don’t need to redeploy the application nor restart the server.

Note for JBoss EAP 6 / JBoss AS 7 users:’ make sure you have set the development attribute to “true” in your jsp-configuration’ :

<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
            <configuration>
                <jsp-configuration development="true" keep-generated="false" check-interval="1" modification-test-interval="1" recompile-on-fail="true"/>
            </configuration>
            <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
            <virtual-server name="default-host" enable-welcome-root="true">
                <alias name="localhost"/>
                <alias name="example.com"/>
            </virtual-server>
 </subsystem>

WildFly users, on the other hand, need to specify development mode to true in the jsp-config element:

<subsystem xmlns="urn:jboss:domain:undertow:1.1">
. . . .
   <servlet-container name="default" default-buffer-cache="default" stack-trace-on-error="local-only">
       <jsp-config development="true" check-interval="1" modification-test-interval="1" recompile-on-fail="true"/>
   </servlet-container>
</subsystem>

Found the article helpful? if so please follow us on Socials