How to use the NetBeans IDE to create a simple Web application

Source: Internet
Author: User
Tags glassfish java web tomcat apache tomcat netbeans

This document will introduce you to the basics of developing WEB applications using the NetBeans IDE. It demonstrates how to create a simple WEB application, deploy the application to a server, and see how the application behaves in a browser. The application uses a JavaServer pages™ (JSP) page to require you to enter your own name. The javabeans™ component is then used to retain the name during the HTTP session and retrieve the name for output to the second JSP page.

To learn this tutorial, you need the following software and resources.

Software or Resources Required Version
NetBeans IDE 6.5 or 6.7 Java version
Java Development Kit (JDK) Version 6 or version 5
GlassFish Application Server
Or
Tomcat Servlet Container
2.1 or 3.0.1

Version 6.x

Attention:

When performing a Web & Java EE installation, you have the option of installing the GlassFish 2.1 application server and the 6.0.x version of the Apache Tomcat Servlet container. You must have one installed to complete this tutorial.

To take advantage of the NetBeans IDE's Java EE 5 feature, use an application server that fully complies with the Java EE 5 specification, such as the GlassFish 2.1 UR2 application Server. If you are using a different server, consult the release notes and FAQs for known issues and solutions. For more information about supported servers and Java EE platforms, see the release notes.

If you need to compare your project to a work solution, you can download the sample application.

Setting up a WEB application project

Choose File > New Project (CTRL-SHIFT-N) from the main menu. Under Categories, select Java Web. Under Projects, select Web Application, and then click Next.

In step 2, enter Helloweb in the Project Name text box.

Specify the project location as any directory on the computer. In this tutorial, this directory is called a $PROJECTHOME.

Optionally, select the Use Private folder store check box and specify the location of the Library folder. For more information about this option, see Shared Project library.

Click "Next". The servers and Settings panel opens. Select the version of Java EE that you want to use with your application.

Select the server in which you want to deploy the application. Only servers registered in the IDE are listed here. Note that the context path on the server becomes/helloweb (based on the name you specified for the project in the previous step).

Click "Next". In the Frames panel, click Finish to create the project.

The IDE creates $PROJECTHOME/helloweb project folder. This project folder contains all the source code and project meta data, such as the project's Ant build script. In the IDE, the Helloweb project opens. In the source editor of the main window, the Welcome page index.jsp opens. You can view the project's file structure in the Files window (CTRL-2) and view its logical structure in the Projects window (CTRL-1).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.