netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序

netbeans ide

In the last lesson we created our first Servlet Application but without using any IDE. An IDE is Integrated Development Environment, and it makes creating applications a lot easier. We will learn how to create Servlet applications on NetBeans IDE and Eclipse IDE. Then you can decide which one, you want to use.

在上一课中,我们创建了第一个Servlet Application,但没有使用任何IDE。 IDE是集成开发环境,它使创建应用程序变得容易得多。 我们将学习如何在NetBeans IDE和Eclipse IDE上创建Servlet应用程序。 然后,您可以决定要使用哪一个。

Using Intregrated Development Enviroment(IDE) is the easiest way to create Servlet Applications. An IDE is a software application that provides facilities to computer programmers for software development. Eclipse, MyEcplise, Netbeans are example of some popular Java IDE.

使用Intregrated Development Enviroment(IDE)是创建Servlet应用程序的最简单方法。 IDE是一种软件应用程序,为计算机程序员提供用于软件开发的工具。 EclipseMyEcpliseNetbeans是一些流行的Java IDE的示例。

在Netbeans IDE中创建Servlet应用程序的步骤 (Steps to Create Servlet Application in Netbeans IDE)

To create a servlet application in Netbeans IDE, you will need to follow the following (simple) steps :

要在Netbeans IDE中创建servlet应用程序,您将需要执行以下(简单的)步骤:

  1. File -> File- > New Project New Project
    netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序
  2. Java Web -> Java Web- > Web Application, then click on Next, Web Application ,然后单击Next,
    netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序
  3. netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序
  4. Finish 完成
    netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序
  5. netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序
  6. Source Package, right click on Source Package ,右键单击default packages -> 默认包 -> New -> New- > Servlet. Servlet
    netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序
  7. netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序
    netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序
  8. netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序
  9. netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序
  10. Web Pages -> Web页面 -> New -> New- > HTML HTML
    netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序
  11. index, because browser will always pick up the index ,因为浏览器将始终自动从目录中提取index.html file automatically from a directory. Index file is read as the first page of the web application. index.html文件。 索引文件被读取为Web应用程序的首页。
    netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序
  12. netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序
  13. web.xml file. In the web.xml file you can see, we have specified the web.xml文件。 在web.xml文件中,您已经指定了url-pattern and the url-patternservlet-name, this means when servlet-name ,这意味着当访问hello url is accessed our Servlet file will be executed. hello url时,将执行我们的Servlet文件。
    netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序
  14. Run 运行
    netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序
  15. netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序
  16. netbeans ide_使用Netbeans IDE创建第一个Servlet应用程序

翻译自: https://www.studytonight.com/servlet/creating-servlet-in-netbeans.php

netbeans ide