在Tomcat中使用WebLogic JSP编译器 [英] Using the WebLogic JSP Compiler in Tomcat

查看:67
本文介绍了在Tomcat中使用WebLogic JSP编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用WebLogic 10.3.4开发一个Webapp.在进行JSP编辑和在浏览器中查看结果之间的转换时间过长,我们的UI团队正痛苦不堪.使用Tomcat 7.0可以使事情变得容易得多,但这使用了与我们所针对的JSP编译器不同的JSP编译器.

我的问题是,是否可以替换Tomcat中的默认编译器并替换为WebLogic的编译器?如果是这样,我该怎么做?我们知道可以从命令行调用WebLogic编译器(我们在构建中使用了它).过去您似乎可以使用IBM Jikes编译器进行此操作 ,但我找不到任何提及WebLogic的内容.

解决方案

---编辑为问题略有改变---

由于Tomcat JSP编译器已集成到Tomcat中,因此您无法轻松地将Tomcat JSP编译器换成另一个JSP编译器.尽管所有JSP编译器都以类似的方式运行,但是重新进行一个系统与另一个编译器的集成的成本是导致这种交换不容易执行的原因.大多数Web容器不会将这些编译器称为进程外,而是在Web容器中的专用线程上启动它们.

也就是说,也许您可​​以避免一起在Web容器中进行编译.如果使用Tomcat或Weblogic JSP编译器预编译JSP页面,则可以简单地将以前的JSP页面作为.class文件打包到WAR中,并且当需要首次访问上述JSP时文件,Web容器将不必在类访问时间之上暂停额外的时间,即可将JSP编译为.class文件.

JSP编译器与常规Java编译器非常相似,主要区别是它们将JSP文件作为源代码"而不是.java文件.一旦为JSP编译器确定了参数,CLASSPATH和参数,就可以将其集成到构建链中,就像处理常规的.java文件一样.

使用Tomcat的JSP编译器进行预编译的详细信息.

有关使用Weblogic的JSP编译器进行预编译的某些信息. /a>

---原始帖子紧随其后---

是的,有可能;前提是两者的编译器都支持相同的Java版本,并且配置为编译为相同的Java版本.

We are developing a webapp using WebLogic 10.3.4. our UI team is experiencing pain with the slow turnaround times between a JSP edit and seeing the results in their browser. Things are a lot easier with Tomcat 7.0 but this uses a different JSP compiler from the one we are targetting.

My question is, is it possible to swap out the default compiler in Tomcat and replace with the one from WebLogic? If so, how would I do this? We know that the WebLogic compiler can be called from the command line (we have it in our build). It looked like you could do this with the IBM Jikes compiler in the past, but I can't find any mention of WebLogic.

解决方案

--- Edited as question changed slightly ---

You cannot easily swap out the Tomcat JSP compiler for another JSP compiler, as the Tomcat JSP compiler is integrated into Tomcat. While all JSP compilers function in a similar manner, the cost of reworking the integration of one system with another compiler is the reason such a swap is not easily performed. Most web containers do not call these compilers out-of-process, but rather they launch them on dedicated threads in the web container.

That said, perhaps you can avoid compilation in the web container alltogether. If you pre-compile your JSP pages with either the Tomcat or the Weblogic JSP compiler, then you can simply package the previous JSP pages into the WAR as .class files, and when the time comes for the first-access of the previously mentioned JSP file, the web container will not have to pause an additional amount above class access time to compile the JSP into a .class file.

JSP compilers are very much like regular Java compilers, with the main exception being that they take JSP files as "source code" instead of .java files. Once you work out the arguments, CLASSPATH, and parameters for your JSP compiler, you can integrate it into your build chain just like you do your regular .java files.

Details on precompiling with Tomcat's JSP compiler.

Some information on precompiling with Weblogic's JSP compiler.

--- Original Post follows ---

Yes, it is possible; provided that the compilers for both support the same release of java, and are configured to compile to the same release of Java.

这篇关于在Tomcat中使用WebLogic JSP编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆