Title: Apache Tomcat Server
1Servers Server-side Languages
Apache Tomcat Server installation use
Server-side language
-- use Java Server Pages
Contrast Client-side languages
-- like Javascript
HTML Forms
Queries Sent From Browser To Server
for JSP program
2Java Server Pages
Contrast with JavaScript
HTML Forms
to identify invoke Java Server Page program on
server
Structure of HTML Forms
-- named variables action
3Javascript
- executed by browser gives dynamic effects
HTML
- used by browser - to define content layout
versus
Server-side languages like JSP PHP
Java programs JSP run on/executed by server
- At request of client
- Results returned to client in HTML page
4JavaScript Request-Response
contains JavaScript
CLIENT-SIDE SCRIPT
5Server-side Program Request-Response
compiles executes code
replaces code with Results
SERVER-SIDE CODE or SCRIPT
Code compiled once
Server treats extensions .jsp .html differently
6Three Tier Architecture
browser displays page
Three Tier Architecture
7User enters data.
HTML Forms
Browser sends data To server that sent Form.
Form identifies server program that processes the
data.
Form
Input fields
name
age
Triggers transmission of data to server
Submit button
submit
8Program on server
Sends data in query-string
lthtmlgtltheadgt lttitlegt HTML Form lt/ title gt lt/
head gt ltbodygt lth1gt Please enter data lt/ h1
gt lt/ body gt lt/ html gt
ltform ACTION "getUserInfo.jsp" Method
"GET" gt lt/formgt
Name ltinput typetext name firstName
size24 gt ltbrgt Major ltinput typetext name
major size24 gt ltbrgt ltinput typesubmit
value"submit" gt
Variable names
Submits request to server
HTML for Form Source Chapter03/example6a.html
9From Browser TO Server
Query string
Triggered by Form
Data for program
program - on server - requested by HTML Form
http//localhost8080/myapp/chapter03/getUserInfo.
jsp? firstNameaaamajorzzz
WHERE
WHO
WHAT
10Local Foreign Addresses
server
client
Local Address ppp
Foreign Address - 8080
Local Address - 8080
Incoming TCP
Foreign Address ppp