title: How can you force recompilation of jsps in JBoss 4.2?
body: <p>I hit on this nasty behavior on JBoss 4.2 in QA, and I want to nip it in the bud before we go into production and find some other corner case.</p>
  
  <p>A jsp calles a method that had the following signature:</p>
  
  <pre><code> public void methodName(String arg)
  </code></pre>
  
  <p>This was changed to:</p>
  
  <pre><code> public void methodName(String arg, Object... args)
  </code></pre>
  
  <p>A pre-existing JSP called this method via:</p>
  
  <pre><code> methodName("param");
  </code></pre>
  
  <p>On deployment of the modified code, JBoss did not recompile the JSP and this caused a crash in QA. Adding a silly comment to the jsp fixed the problem (JBoss recognized that the JSP changed and recompiled it).</p>
  
  <p>Is there a setting on JBoss to force recompilation of JSPs on restart?</p>
  
  <p>EDIT: To clarify some points in the answer, the setup is that the JSPs are part of a war which is part of an ear. The ear has all classes in it, in a jar.</p>
  
  <p>Regarding the desire to pre-compile, if the system doesn't think that the jsp needs compilation, will pre-compile force recompilation? It doesn't seem so. The error here is not a compliation error, it is a method invocation error because of the "changed" (at the byte code level, not really at the code level) method signature.</p>
  
  <p>Addendum: Note that we experienced in production recently that even with the accepted answer's flag set the JSPs did not recompile, even though the JSP did in fact change. Major bug there, but regardless, JBoss was shutdown normally. At this point it is getting to be an old version of JBoss, but if you are still using it, deleting the content of the work and tmp directories is the only way to be sure.</p>
  
  <p>I'm not changing the accepted answer simply because it really gets to the point of what the question was looking for. JBoss bugs are kind of a separate issue.</p>