문제

Since JSPs adhere to a standard API, can I precompile them in my projects and then deploy the result on any server?

Specifically, I'm using Tomcat, JBoss and WebSphere.

도움이 되었습니까?

해결책

No, not really. If you look at the java source that gets created by the JSP compiler, you'll see that it extends a base class that's proprietary to the container. For example, JBoss 4's servlet container generates JSP classes that extend org.apache.jasper.runtime.HttpJspBase, which is Tomcat and JBossWeb-specific.

So you might be able to reuse pre-compiled JSPs between different tomcat-based servers, but even then it might not work.

다른 팁

Since the servlet/JSP engines are different between app servers there could be byte code added that's not portable.

I'd have to write a test to confirm it. If I have time I'll try it with Tomcat and WebLogic and report back.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top