没有在Eclipse WTP和Tomcat中发布的服务模块的技术细节? [英] Technical details of serve modules without publishing in Eclipse WTP and Tomcat?

查看:141
本文介绍了没有在Eclipse WTP和Tomcat中发布的服务模块的技术细节?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Eclipse的Web Tools Platform(WTP)允许您将Tomcat配置为不发布服务器模块:

Eclipse's Web Tools Platform (WTP) allows you to configure Tomcat to "Server modules without publishing":


将提供Web内容直接从动态Web项目的WebContent文件夹。使用自定义上下文来使项目的依赖项可用于Web应用程序的类加载器。

Web content will be served directly from the "WebContent" folder of the Dynamic Web Project. A customized context is used to make the project's dependencies available in the Web application's classloader.

在5步过程中(只是开玩笑,你选择步骤数),技术上会发生什么,Eclipse在哪里产生?我注意到,Eclipse在Tomcat lib目录中生成了一个 org.eclipse.jst.server.tomcat.runtime.70.loader.jar 文件。

In a 5 step process (just joking, you pick the # of steps), what happens technically and where are the files that Eclipse generates? I did notice that Eclipse generated a org.eclipse.jst.server.tomcat.runtime.70.loader.jar file in the Tomcat lib directory.

推荐答案

这个想法是直接从开发工作区的分散目录结构提供Web应用程序,而不是将模块封装到JAR中,然后最终以code> WEB-INF / lib 在WAR中。

The idea is to serve a web application directly from the scattered directory structure of the development workspace, without packaging modules into JARs which then end up in WEB-INF/lib in a WAR.

主要优点是:


  • 您不需要构建存档。

  • 更改工作空间中的资源时,更改将反映在正在运行的webapp中,而不会重新部署webapp或重新启动服务器。

使用Servlet 3.0,网页资源也可能被捆绑在图书馆JAR中 META-INF / resources ,所以类资源可能来自多个工作空间目录。

With Servlet 3.0, web resources may also be bundled in library JARs in META-INF/resources, so classes and resources may come from multiple workspace directories.

Tomcat 7.0支持一个 VirtualWebappLoader VirtualDirContext 根据分散的资源和类目录的集合配置Web应用程序。

Tomcat 7.0 supports a VirtualWebappLoader and a VirtualDirContext to configure a web application based on a collection of scattered resource and class directories.

为了直接从Eclipse工作区提供Web应用程序,WTP将生成一个与 $ WORKSPACE / .metadata / .plugins / org.eclipse.wst.server.core / tmp1 / conf / server.xml

To serve your web app directly from your Eclipse workspace, WTP generates a suitable Tomcat configuration matching your project structure in $WORKSPACE/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/conf/server.xml

由于某些原因,WTP不直接使用Tomcat加载器和上下文实现,但是它们有一些稍微不同但相似的 WtpDirContext WtpWebappLoader (我相信这种方法比Tomcat当前的解决方案要早,TLD扫描有一些特殊的逻辑 - 我不知道这是否仍然需要最新的Tomcat版本。)这些帮助类包含在 org.eclipse.jst.server.tomcat.runtime.70.loader.jar 你注意到。

For some reason, WTP does not directly use the Tomcat loader and context implementations but has its own WtpDirContext and WtpWebappLoader which are slightly different but similar. (I believe this approach is older than the current solution in Tomcat. There is some special logic for TLD scanning - I'm not sure if this is still required with the latest Tomcat versions.) These helper classes are contained in the org.eclipse.jst.server.tomcat.runtime.70.loader.jar you noticed.

没有服务模块而不发布,当您在库模块中更改 META-INF / resources 中的Web资源时,此更改将不会直接显示在正在运行的应用程序中在浏览器中重新加载当前页面后。

Without Serve modules without publishing, when you change a web resource in META-INF/resources in a library module, this change will not be directly visible in the running application after reloading the current page in the browser.

这篇关于没有在Eclipse WTP和Tomcat中发布的服务模块的技术细节?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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