You are on page 1of 6

8/27/2014

First JSP/Servlet Workshop | JSP & Servlets | Java Programming

Tech-Freaks.com Technically Driven To Perfection!

Free Framework Download


restlet.com/Download
Open Source Restlet Framework Create Your Custom Web API Today.

First JSP/Servlet Workshop

Rating 3.00 (1 Vote)

Category: JSP & Servlets


Published on Wednesday, 16 July 2008 16:35
Written by Tech Programmer
Hits: 7075
First JSP/Servlet Workshop
Design & Coding
Creating Web Application in Tomcat
Test Drive time
All Pages

Page 1 of 4

The Best Dedicated


Server
softlayer.com/dedicated-server

Our Dedicated Servers Are the


Most Secure & Powerful. Chat to
Save!

Like

Share Be the first of your friends to like this.

This workshop is for you, if you thinking:


My simple Java code has a main method. I have heard that JSPs and Servlets do not have main method.
So, how does it work?
I've read a lot about web.xml, servlet callback methods, JSP implicit variables etc. But how to use them all
to make it work together?
This workshop is not for you, if you are thinking:
http://www.tech-freaks.com/jsp-servlets/jsp-servlet-workshop.html

1/6

8/27/2014

First JSP/Servlet Workshop | JSP & Servlets | Java Programming

How to write Java file and compile it?


I dont have any clue what JSP or Servlet is
What is a Application server?
Am an expert writing JSP and Servlets, lets see how others write them
Requirement:
Create a simple web page which has two fields, first name and last name as input fields.
When both values are entered and submitted, 'Your Name is : <First Name> <Last name>' should be
displayed.
When any one value is not entered, the web page should display, 'Please enter first name' or 'Please enter
Last name' or both as per the entry made by the user.
Here we go....
1. Installing an application server:
We will be using Tomcat Application server this example. Download and install Tomcat from the
http://tomcat.apache.org/
For this example, we will be using Tomcat 6.x. The table below maps the Tomcat version with Servlet
specification. Tomcat 6.x is based on Servlet 2.5 specification. Tomcat 6.x installation requires the existence of
J2SE/JRE 1.5 or above.

Servlet/JSP

Tomcat

J2SE

2.5/2.1

6.0.16

1.5 or above

2.4/2.0

5.5.26

1.3 or above

2.3/1.2

4.1.37

1.2 or above

Below are the easy steps which will guide you through the installation process in Windows environment.
Click Next on the first screen and accept the terms of agreement to proceed with the installation.

http://www.tech-freaks.com/jsp-servlets/jsp-servlet-workshop.html

2/6

8/27/2014

First JSP/Servlet Workshop | JSP & Servlets | Java Programming

In the Choose component screen (See the screenshot above), select 'Services' checkbox to enable Tomcat
as Windows service. This is a nice feature to have. You may also want to select 'Examples', if you want to
have some JSP/Servlet samples installed by default. Click Next to continue.

In the Choose Install Location screen (See the above screenshot), browse to the folder where you want
Tomcat to be installed and click Next.
http://www.tech-freaks.com/jsp-servlets/jsp-servlet-workshop.html

3/6

8/27/2014

First JSP/Servlet Workshop | JSP & Servlets | Java Programming

In the Configuration screen, select the port on which you want Tomcat should listen to. By default it will be
8080 and it can be left as it is, unless you have some other application already listening on this port. You
may also want to provide a password for the admin user

In the Java Virtual Machine screen, by default any SDK or JRE of 1.5 or above will be displayed. You will
need to have either JRE 1.5 or higher or SDK 1.5 or higher for installing Tomcat 6.x. Click Next to begin the
http://www.tech-freaks.com/jsp-servlets/jsp-servlet-workshop.html

4/6

8/27/2014

First JSP/Servlet Workshop | JSP & Servlets | Java Programming

installation process.
Click the finish button to complete the installation process.
You can now test your installation by starting Tomcat and access the URL http://localhost:8080/ assuming
that Tomcat is listening on port 8080.
Tomcat will be waiting there to congratulate you, on successful installation!

< Prev

Add comment
Name (required)
E-mail
Title

1000 sym bols le ft

Notify me of follow-up comments

Refresh

Send

Phone Apps

Windows Phone Apps

Java Programming

Java Basics
JSP & Servlets
Javascripts
Websphere Commerce
Rapid Code
http://www.tech-freaks.com/jsp-servlets/jsp-servlet-workshop.html

5/6

8/27/2014

First JSP/Servlet Workshop | JSP & Servlets | Java Programming

SimplyMarry
Matrimonial
simplymarry.com/Free-Matrimonial

Registration & Contact 100% Free.


Biggest Change in Indian
Matrimony!

Joomla

Installation

OS Troubleshooting

Windows XP

http://www.tech-freaks.com/jsp-servlets/jsp-servlet-workshop.html

6/6

You might also like