Introduction to Servlets http: //flic. kr/p/h. Arj 5
Why web apps? http: //flic. kr/p/9 DTDXi • Create apps every bit as dynamic, interactive, and custom tailored as native apps • Avoid deployment problems • Reach people world wide
First, let’s review some basics about how the Web works
The architecture of the Web Head First Servlets and JSP (2 nd edition), p. 3
Typical web browser/server interaction Head First Servlets and JSP (2 nd edition), p. 4
Basic anatomy of a URL Head First Servlets and JSP (2 nd edition), p. 20
Example HTTP GET request ) r now o red (f o Censored Head First Servlets and JSP (2 nd edition), p. 15
Example HTTP response Head First Servlets and JSP (2 nd edition), p. 17
The Big Picture Head First Servlets and JSP (2 nd edition), p. 18
Now, let’s talk about web apps and Servlets
Typical architecture of a web app Head First Servlets and JSP (2 nd edition), p. 27
GET requests can include params with the URL Head First Servlets and JSP (2 nd edition), p. 14
Limitations of GET parameters • Total characters limited (varies by server) • Parameters are exposed – Better not do passwords Fortunately, there is also an HTTP POST method
Example POST request Head First Servlets and JSP (2 nd edition), p. 16
Servlet web app architecture Head First Servlets and JSP (2 nd edition), p. 39
Let’s walk step by step through how to create and deploy a servlet using Tomcat
Head First Servlets and JSP (2 nd edition), pp. 30– 31
Head First Servlets and JSP (2 nd edition), pp. 30– 31
Head First Servlets and JSP (2 nd edition), pp. 30– 31
Head First Servlets and JSP (2 nd edition), pp. 30– 31
Head First Servlets and JSP (2 nd edition), pp. 30– 31
Head First Servlets and JSP (2 nd edition), pp. 30– 31
Head First Servlets and JSP (2 nd edition), pp. 30– 31
Head First Servlets and JSP (2 nd edition), pp. 30– 31
Head First Servlets and JSP (2 nd edition), pp. 30– 31
Perhaps, now would be a good time for a demonstration http: //flic. kr/p/a. Gv. Aai
Summary • • Web architecture HTTP and HTML Web app architecture Servlet web app architecture http: //flic. kr/p/YSY 3 X