Are JSPs generally shipped as .jsp files , pre-compiled Java files or pre-compiled class files?

烈酒焚心 提交于 2019-12-05 20:52:13

The Servelts/JSP spec says nothing about precompiling JSPs making this feature specific to container implementation. You can pre-compile for a specific container, say for Tomcat or for WebLogic and you will surely find Ant tasks to do so.

Generally, when you package your app you know your target. If it's more than one container (say you package a downloadable product) then your only option is to package raw JSPs into your WAR file. That said, however, when you're in development and/or testing you certainly can pre-compile as part of your build process to a) validate that your JSPs are correct and b) speed up the start-up time. You can even have your Eclipse do it for you if you need that extra validation step as you are building your software.

I don't think there's an industry practice to do one way or the other. From what I have experienced the JSPs are usually packaged "raw" (not pre-compiled) for deployment and distribution but are pre-compiled as part of build/test process.

In my experience, they are just shipped in the WAR as .jsp files. The application server will automatically compile the .jsp into a class file. See here for more info on the jsp life cycle.

They are packaged as .jsp files itself. Please do take care about the jsp file size limit of 64K jsp file size limit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!