Upload
lucas-weaver
View
226
Download
4
Embed Size (px)
Citation preview
Course OverviewJAVA
C/C++ and JAVA Comparison
OOP in JAVA
Exception Handling
Streams
Graphics User Interface
Event Handling
Game Programming
Graphics
Database Connectivity
Network Programming
J2EE
HTML / CSS
JavaScript
Servlets
JSP
JSF
JAVA Beans
JSP using XML Tags
MVC Architecture
Programming in Layers
XML technologies
Communication model
Web server cannot distinguish if request is made from same browser or not
Its stateless
http doesn’t store any details how request is made
What is web server?
Webserver hosts website and offers protocol http
It takes request and response
It’s a software to provide services to access internet
Web server executes server side programmes
Example
Facebook login
User request something
Client response something
http protocol is used for communication
Example :
Pdf files, doc files
Http
Its a request – response model or oriented protocol
Http request contains the following:
Request Method
URI
Header Fields
Body
Http request Example
www.facebook.com
In Request following are sent:
GET-POST/
URI = home.html
http protocol
Headers :
Host : facebook.com
User –Agent : Google Chrome
Body :
Request parameters
HTTP response Example
Status line : tells if its error or ok response
Response headers :
Last modified: some date
Date: current date
Content type: html/text
content length: 50
Dynamic Website
Client Sends a request to server
Server side does some computation and response with html page with result generated of computation
Why dynamic pages and not static?
Dynamic Websites
www.google.com
Results depends on our query
www.facebook.com
Results depends on user login and database
Servlets
Its a java class
Servlets extend webserver to extend its capability
It allows us to compute on webserver and gives us a response
Request
Response
Servlets
Any class in java can be written in servlets
We don’t have to write http protocol mechanism
Rich set of libraries of java available in servlets
E.g.
JDBC
Multithreading
E.t.c
Servlet Advantages
Rich set of libraries
Built in multithreading – treats every request as multithread rather than creating new process
Portable across operating systems
Security – jvm verifier