Download presentation
Presentation is loading. Please wait.
Published byGervais Gibson Modified over 9 years ago
1
Chapter 3 Servlet Basics
2
Contents A.Installing Eclipse WTP and configuring Tomcat B.Prime Number Problem C.Multiplication Table Problem
3
A. Installing Eclipse WTP and configuring Tomcat 1.Installing Eclipse WTP 2.Configuring Tomcat
4
1. Installing Eclipse WTP Download Eclipse IDE for Java EE aDevelopers at http://www.eclipse.org/downloads/ http://www.eclipse.org/downloads/ Extract the file eclipse-jee-europa-winter- win32.zip Run eclipse.exe file to start Eclipse
5
2. Configuring Tomcat Click Windows > Preferences… Preferences Server > Installed Runtimes Click Add…
6
Preferences (cont.) New Server Runtime Select the version of Tomcat you have installed Click Next
7
Tomcat Server Click Browse to specify the Tomcat home directory Click Finish
8
B. Prime Number Problem Write a program that shows all prime numbers from 1 to 1000 as below:
9
Solution 1. Creating New Dynamic Web Project 2. Developing the Servlet 3. Running the Project
10
1. Creating New Dynamic Web Project Click File > New > Project… New Project Dynamic Web Project > Next
11
New Dynamic Web Project Project name: PrimeNumbers Click Finish
12
2. Developing the Servlet 2.1. Creating Servlet Template 2.2. Developing doGet() 2.3. Developing the Model
13
2.1. Creating Servlet Template Click File > New > Other > Servlet
15
2.2. Developing doGet()
16
2.3 Developing the Model
17
2.4. Running the Project Right click to the Sevrlet -> Run As -> Run on Server
18
C. Multiplication Number Problem Write a program that shows the multiplication table as bellow:
19
Solution Project name: MultiplicationTable
21
References 1.Core Servlets And Java Server Pages, Volume 1, 2 nd Edition, Chapter 3
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.