Before uploading a web site on ASP.NET to a server, you can do a so-called precompilation after which the web site is converted to some format that only the server can understand. The idea is that it works faster and the source code is hidden. Is it possible to do something like this for JSP? In Java, it’s good that classes are compiled into byte-code, but the pages remain and can be viewed by opening the .war file with any archiver.

  • The ASP.NET website deployed on the server source codes, too, when you run the application, is precompiled into the IIS folder, from where it is executed. - Ildar

1 answer 1

When you first launch the web container, it will expand the WAR, then the first time you access the JSP, they will be compiled into servlets (so-called precompilation), then the servlets will be compiled into .class files.

You can of course do all this hand-to-hand yourself - in general, it depends on the JSP compiler, which may depend on the web container. For example for the Jasper Tomcat compiler it is described here.