Automatic jsp recompile on Jboss AS 7

Most of the applications I work on are based on jsp's and usually run on Jboss AS of various versions. And even though the newer applications are maven based and run on Jboss AS 7, almost nothing have changed in a matter of development. At least I thought that nothing have changed, but that was only because my carelessness.
When you are developing web tier, there is no compiler telling you what is wrong in the real time, you depend on syntax validation only. And that enables you to do a lot of small mistakes that usually end up with error 500 and a need to redeploy the application.
But this is the case only until you discover the right configuration!
We are currently using Jboss AS 7.1.1.Final as our target runtime, but as soon as I have searched for automatic jsp recompiling, I found a known issue which affects the very same version.
This leaves you with a handful of solutions. These are the ones I find viable.
  • use the version 7.1.0.Final for development
  • use the version 6.1.0 Alpha (EAP alpha built from AS7)
  • modify your Jboss 7.1.1.Final according to this post
I personally chose to use EAP 6.1.0 Alpha, mostly because I did not wanted to use older version (7.1.0.Final) and I prefer not to tamper with core server libraries. And I generally assume that newer is better. EAP 6.1.0 Alpha corresponds to Jboss AS version 7.2.0.Alpha and I have not found any compatibility issues yet. And if you are wondering why I have not chosen the version 6.1.0 Final, it is because only the Alpha is easily downloadable (without registration).

Now the configuration itself. You can either edit standalone.xml or you can use the server's web console.

Manual standalone.xml edit. You just need to insert these three lines into subsystem "urn:jboss:domain:web". This configuration is nearly the same whether you chose Jboss AS 7.1.x or EAP 6.1.0 (the only difference is the version of the subsystem: EAP 6.1 runs 1.4 while AS 7.1.x runs 1.1).
<!-- the next line already exists -->
<subsystem xmlns="urn:jboss:domain:web:1.4" default-virtual-server="default-host" native="false">
<configuration>
   <jsp-configuration development="true" check-interval="1" modification-test-interval="1" recompile-on-fail="true"/>
</configuration>

Web console approach is a bit easier and more transparent. The only thing you need is an user with web-console access. Than is is only a matter of a few steps.
  1. select the Profile tab on top
  2. select the Web in the menu on the right
  3. select Servlet/HTTP
  4. click Edit button
  5. check the Development? checkbox
  6. (optional) under the Advanced choose a custom Check Interval
  7. click Save button
  8. restart/reload the server

That's it! All you need to do now is to start up the server and modify your jsp's all you want without the need for the redeployment. Cheers!

Comments

  1. I am using jboss-as-7.1.1 and after making the changes it is not working.

    ReplyDelete
    Replies
    1. Hey, are you sure you have done what http://mobiarch.wordpress.com/2013/02/22/configure-automatic-publishing-from-eclipse-for-jboss-as-7/ suggests? Modifications in my post apply only to EAP 6.1.0 Alpha. If you want to use jboss-as-7.1.1, you have to replace one library as mobiarch propose.

      Delete
  2. Great Article on JSP recompile. DO you have any article on JSF compilation process please

    Java EE online training | Java Training in Chennai

    ReplyDelete
  3. Nice Info Regarding Automatic jsp recompile on Jboss AS 7 My sincere thanks for sharing this post Please Continue to share this post
    Java Training in Chennai

    ReplyDelete
  4. I am really happy to found such a helpful and fascinating post that is written in a good manner. Thanks for sharing such an informative post.
    Java Training in Chennai
    Best Java Training Center in Chennai

    ReplyDelete
  5. Hi, I am a big follower of your blog. Really very informative post you shared here. Keep sharing this type of informative blog. Waiting for your next update. If anyone wants to become a Java professional learn Java Training in Bangalore. Nowadays Java has tons of job opportunities for all professionals.

    ReplyDelete
  6. Great Article… I love to read your articles because your writing style is too good, it is very very helpful for all of us and I never get bored while reading your article because,
    Java Training in Chennai
    Devops Training in Bangalore

    ReplyDelete
  7. The share you really give us excitement. Thanks for your sharing. If you feel tired at work or study try to participate in our games to bring the most exciting feeling. Thank you!Python Online Training | Learn Python Online

    ReplyDelete
  8. Automatic jsp recompile on Jboss AS 7 : This Blog is Just Awesome with rare details thank you For sharing the details.
    Devops Training in Bangalore

    ReplyDelete
  9. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition.

    Best AWS training in bangalore

    ReplyDelete
  10. Hi
    I dont find this line <subsystem xmlns="urn:jboss:domain:web:1.4" on jboss7.0. can any one pls point out where can i find that tag in standalone.xml


    Thanks
    Ravi S.P

    ReplyDelete

Post a Comment

Popular posts from this blog

Ldap security for Jenkins CI

Simple EJB Arquillian test based on JUnit running on managed JBoss AS 7