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是一种软件应用程序,为计算机程序员提供用于软件开发的工具。 Eclipse , MyEcplise和Netbeans是一些流行的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应用程序,您将需要执行以下(简单的)步骤:
-
File -> File- > New Project
New Project
-
Java Web -> Java Web- > Web Application, then click on Next,
Web Application ,然后单击Next,
-
Finish
完成
-
Source Package, right click on Source Package ,右键单击default packages -> 默认包 -> New -> New- > Servlet.
Servlet 。
-
-
Web Pages -> Web页面 -> New -> New- > HTML
HTML
-
index
, because browser will always pick up theindex
,因为浏览器将始终自动从目录中提取index.html
file automatically from a directory. Index file is read as the first page of the web application.index.html
文件。 索引文件被读取为Web应用程序的首页。 -
web.xml file. In the web.xml file you can see, we have specified the web.xml文件。 在web.xml文件中,您已经指定了url-pattern and the url-pattern和servlet-name, this means when servlet-name ,这意味着当访问
hello
url is accessed our Servlet file will be executed.hello
url时,将执行我们的Servlet文件。 -
Run
运行
翻译自: https://www.studytonight.com/servlet/creating-servlet-in-netbeans.php
netbeans ide