Download presentation
Presentation is loading. Please wait.
Published byLucas Weaver Modified over 9 years ago
1
Java Omar Rana University of South Asia
2
Course Overview JAVA C/C++ and JAVA Comparison OOP in JAVA Exception Handling Streams Graphics User Interface Event Handling Game Programming Graphics Database Connectivity Network Programming
3
J2EE HTML / CSS JavaScript Servlets JSP JSF JAVA Beans JSP using XML Tags MVC Architecture Programming in Layers XML technologies
4
Web Application Java Categories J2me J2sdk J2EE
5
J2EE Examples
6
Web Application Model Request Response
7
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
8
Different Clients Web browsers ftp clients
9
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
10
Example Facebook login User request something Client response something http protocol is used for communication Example : Pdf files, doc files
11
Http Its a request – response model or oriented protocol Http request contains the following: Request Method URI Header Fields Body
12
Http Response Http Response contains: Result code Header Fields Body
13
Http request Example www.facebook.com 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
14
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
15
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?
16
Dynamic Websites www.google.com www.google.com Results depends on our query www.facebook.com www.facebook.com Results depends on user login and database
17
J2EE APPLICATION STRUCTURE
18
JAVA web application technologies
19
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
20
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
21
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
22
Software's Required Eclipse / net Beans Tomcat Server J2SE J2EE
23
Servlet Hello World To write Servlet we need to extend from HttpServlet Import javax.servlet.*; Import javax.servlet.http.*;
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.