使用Eclipse时Run on Server的HTTP Preview和HTTP Server和J2EE分别是什么以及怎么选?

使用Eclipse时Run on Server的HTTP Preview和HTTP Server和J2EE分别是什么以及怎么选?

HTTP Preview:
根据官方文档介绍:
Use the HTTP Preview server when you want to quickly test resources in a static Web project. The HTTP Preview server is a Hypertext Transfer Protocol (HTTP) embedded test server that is integrated with the workbench. It is intended for preliminary testing and saves you time to download, install, and set up an HTTP server. However, as your static Web project progresses through its development cycle you are encourage to test and run on an external HTTP server. You can use the HTTP Preview server as a convenient way to check for errors before you do a final test on an external HTTP server.
翻译一下就是:
当您想要快速测试静态 Web 项目中的资源时,请使用 HTTP 预览服务器。HTTP 预览服务器是与工作台集成的超文本传输​​协议 (HTTP) 嵌入式测试服务器。它旨在用于初步测试并节省您下载、安装和设置 HTTP 服务器的时间。但是,随着您的静态 Web 项目在其开发周期中的进展,我们鼓励您在外部 HTTP 服务器上进行测试和运行。在对外部 HTTP 服务器进行最终测试之前,您可以使用 HTTP 预览服务器作为检查错误的便捷方式。
使用步骤:
要在 HTTP 预览服务器上创建和测试以在静态 Web 项目中预览您的资源,请完成以下步骤:
在 Servers 视图中,右键单击并选择New > Server。定义新服务器向导打开。

  1. 在Select the server type列表下,展开Basic文件夹并选择HTTP Preview。单击下一步。
  2. 添加和删​​除页面打开。在可用项目列表下,选择静态 Web 项目并单击添加按钮。单击完成。HTTP 预览服务器是在服务器视图中创建的。
  3. 在 Project Explorer 视图中,导航到静态 Web 项目并右键单击要测试的资源。
  4. 选择运行方式>在服务器上运行。“在服务器上运行”向导打开。验证选择现有服务器单选按钮是否已启用。
  5. 在选择要使用的服务器列表下,选择最近创建的 HTTP 预览服务器。单击下一步。
  6. 添加和删​​除页面打开。验证您正在测试的静态 Web 项目是否列在已配置项目下。单击完成。
  7. 内部 Web 浏览器打开并显示静态 Web 内容。

J2EE Preview:
根据官方文档介绍:
Use the J2EE Preview server when you want to quickly compile, test and run resources in a J2EE Web project. The J2EE Web projects you can test on a J2EE Preview server are static Web projects, dynamic Web projects and utility projects. Hereafter, the term J2EE Web project refers to any of these previously mentioned projects.

The J2EE Preview server is an embedded application server that is integrated with the workbench. It is intended for preliminary testing and saves you the time to download, install, and set up an application server. However, as your J2EE Web project progresses through its development cycle you are encourage to test and run on an external application server. You can use the J2EE Preview server as a convenient way to check for errors before you do a final test on an external application server.
翻译一下:
当你想快速编译、测试和运行J2EE Web项目中的资源时,请使用J2EE Preview服务器。您可以在 J2EE Preview 服务器上测试的 J2EE Web 项目是静态 Web 项目、动态 Web 项目和实用项目。此后,术语 J2EE Web 项目是指前面提到的这些项目中的任何一个。
J2EE 预览服务器是一个嵌入的应用程序服务器,它与工作平台集成。它旨在进行初步测试,并为您节省下载、安装和设置应用服务器的时间。然而,随着您的 J2EE Web 项目在其开发周期中的进展,您被鼓励在外部应用程序服务器上进行测试和运行。你可以使用 J2EE 预览服务器作为一种方便的方式,在你在外部应用服务器上做最终测试之前检查错误。
使用步骤:

  1. 在服务器视图中,右击并选择新建>服务器。定义一个新的服务器的向导就会打开。
  2. 在选择服务器类型列表下,展开 Basic 文件夹并选择 J2EE Preview。单击 “下一步”。
  3. 添加和删除页面打开。在 Available projects 列表下,选择 J2EE Web 项目并单击 Add 按钮。单击完成。J2EE Preview 服务器在 Servers 视图中被创建。
  4. 在项目资源管理器视图中,导航到您的 J2EE Web 项目并右键单击您要测试的资源。
  5. 选择 Run As > Run on Server。打开 "在服务器上运行 "向导。
  6. 确认选择一个现有的服务器单选按钮被启用。
  7. 在选择你想使用的服务器列表下,选择最近创建的 J2EE 预览服务器。单击下一步。
  8. 添加和删除页面打开。确认你要测试的 J2EE Web 项目被列在配置的项目下。单击完成。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值