Sei sulla pagina 1di 13

C# Corner Annual Conference 2020 Tickets on Sale Now x

Top 10 Cloud Serv


How to Create JSP Web Page in Netbeans
Become IDE 7.4
a member
C# Corner Login
Using Tomcat Server 7.0.40 Post Ask Question
Sandeep Sharma Last updated date Aug 16 2013 380k 4 1

Angular 160+ UI Components - Material & Responsive Design OPEN


Open Source & Free Angular UI Widgets with Material Design and Responsive design amexio.tech

Download Free .NET & JAVA Files API


Try Free File Format APIs for Word/Excel/PDF

Introduction

In this article we discuss how to create a JSP web page in the Netbeans IDE 7.4 using the Tomcat Server 7.0.40.

To create a JSP web page in the Netbeans IDE we must do the following three main steps:

1. Start by creating a "Java web" -> "web application project".


2. Create a JSP web file.
3. Last and finally, start the Tomcat Server and deploy the project.

Step 1: Start creating web application project

Step 1(a)

Open the Netbeans IDE to start your project.


Top 10 Cloud Serv

Become a member
C# Corner Login

Post Ask Question

Step 1(b)

Now click on file menu and select New Project then select Java Web and then Web Application as follows.

From the file menu select "New Project" -> "Java Web" -> "Web Application" as in the following figure:

Step 1(c)

Now click on "Next". A new window is generated with a default project name. Now change the name (I used
"JspWebApplication") according to your project and click on "Next".

As in the following figure:


Top 10 Cloud Serv

Become a member
C# Corner Login

Post Ask Question

Step 1(d)

Now a new window is generated for the server and setting the wizard. First go to the server and click on "Add server". Since I
already set up the Tomcat Server, it is shown there but when you do it the first time it shows blank, see the image below.

Step 1(e): Server and Setting wizard

First you need to configure Apache Tomcat Server 7.0.40

For configuration of the Tomcat Server follow my previous article from the following link:

http://www.c-sharpcorner.com/UploadFile/fd0172/how-to-configure-and-install-apache-tomcat-server-in-windows/
After clicking on Add, a list of servers opens. In this article I used Tomcat Server 7.0.40. Choose your server and configure it.
For Tomcat Server choose it (Apache Tomcat on screen) and click on "Next". Now a window opens asking for the server
location. Now, click on Top
the Browse button
10 Cloud Servand find the server location where you have stored the Apache Tomcat Server (in
my system it is in "E:\myserver\tomcat7.0.40\bin"). Note that you need to provide the path up to the bin directory of Tomcat
Become a member
C# Corner Login
Server. As in the following:
Post Ask Question

Step 1(f)

After providing the server path you will see two more options for username and password. It's your choice whether you want
your username and password or you want the default created by the Netbeans IDE. Now click on "Finish".

Now a window is generated containing the default index.jsp file in Web Pages under JspWebApplication. As in the following:
Top 10 Cloud Serv

Become a member
C# Corner Login

Post Ask Question

Step 2: Create a JSP Page.

Now change some coding in the default JSP page as given below.

index.jsp

Change the title: JSP Web Page

Change the heading: "Welcome To The JSP Web World!" as in the following:
Top 10 Cloud Serv

Become a member
C# Corner Login

Post Ask Question

Step 3: Run The Project using Tomcat Server.

Step 3(a)

First recheck the Tomcat configuration if you have changed the default port number of Apache Tomcat then you need to do
the same in the Netbeans IDE.

For changing the port number of the Tomcat Server use the following.

Go to the services menu and then click on "Servers" and then right-click on "Apache Tomcat" and choose "Properties" as in
the following:
Fig-8.jpg

Top 10 Cloud Serv

Become a member
C# Corner Login

Post Ask Question

Step 3(b)

Now select the server port number that you chose in configuring the Apache Tomcat Server. Since I chose port 9999 in
Apache Tomcat so it needs to be changed in Netbeans also. As in the following:
Fig-9.jpg

Top 10 Cloud Serv

Become a member
C# Corner Login

Post Ask Question

Step 3(c)

Now click on close and run the project. For running your project right-click on the project and select "Run" as follows.

Fig-10.jpg
Output

The following output is generated through the specified JSP file.


Top 10 Cloud Serv

Fig-11.jpg Become a member


C# Corner Login

Post Ask Question

Summary: This article describe how to create a JSP web page in the Netbeans IDE, hope you enjoyed doing it. If you
encounter a problem creating a JSP web page or any issue occur then you can tell me.

Thanks for reading.

Next Recommended Article


How To Create JSP In Eclipse IDE Using Tomcat Server

In this article we discuss how to create JSP in an Eclipse IDE with Tomcat Server.

Hello world web application in netbeans how to create jsp in netbeans ide

jsp in netbeans using tomcat server netbeans web app


Sandeep Sharma

Working as a Senior Engineering Analyst having work experience in Core Java, Struts, Spring,
Top 10 Cloud Serv
Hibernate, Maven, JSP, AJAX, JQuery, JSON, WebService,Jasper-Report,Oracle,MySQL,SQL-Server-
2012. Become a member
C# Corner Login
https://www.c-sharpcorner.com/members/sandeep-sharma35
Post Ask Question
124 6.2m

1 4

Type your comment here and press Enter Key (Minimum 10 characters)

How to make software so that i can install it in my computer and others after deploying project
Ajay Sah May 28, 2019
1879 3 0 0 0 Reply

How to make software after deploying project and distribute friends for installation and use it.
Ajay Sah May 28, 2019
1879 3 0 0 0 Reply

what if apache tomcat is not attached with Netbeans ?


Prachi Chauhan Jun 20, 2016
1880 2 444 0 0 Reply

i found this site to be very easy and helpfull here http://vaaiibhav.me/java-web-application-for-


beginners-using-netbeans-jsp/
Ravi Jaiswal Feb 08, 2016
1881 1 0 0 0 Reply
Top 10 Cloud Serv

Become a member
C# Corner Login

Post Ask Question

TRENDING UP

01 Sign-In Page Customization for Specific Branding in Azure

02 Sealed Class Explained In C#

03 Learn Angular 8 Step By Step In 10 Days - HttpClient Or Ajax Call - Day Nine

04 How To Upload A File To Amazon S3 Using AWS SDK In MVC


05 Getting Started With .NET Core 3.1 - Part One

C# 8.0 - Default Interface Implementation - A New Feature Which Makes The Interface More
06 Flexible
Top 10 Cloud Serv

Become a member
C# Corner Login
07 How To Create SSIS Catalog
Post Ask Question
08 What Can Be Done To Make Code Quality Better

09 A File System Manager From Scratch In .NET Core And VueJS

10 Learn About Extension Methods In C#


View All

About Us Contact Us Privacy Policy Terms Media Kit Sitemap Report a Bug FAQ Partners

C# Tutorials Common Interview Questions Stories Consultants Ideas Certifications


©2020 C# Corner. All contents are copyright of their authors.
Top 10 Cloud Serv

Become a member
C# Corner Login

Post Ask Question

Potrebbero piacerti anche