Web Application Development Lec 25 Web Application Development
Web Application Development Lec 25
Web Application Development n we used J 2 SE until now n For web application development, we need J 2 EE (Servlets API, JSP API, JSF API etc)
Web Based Performance Review Management System
Web Based School Management System
What is a Web Application
HTTP Communication Model A communications model • Client, often but not always a web browser, sends a request for a resource to a server. • The server returns a response or an error message. • Stateless • No immediate feedback • No details on how request is made
HTTP Communication Model Different clients like • Web browsers • FTP clients (e. g. , interarchy on Mac. OS X) • Software registration programs • telnet
HTTP Communication Model Web Server? Software that provides services to access the Internet, or an intranet. A web server hosts web sites Provides support for HTTP and other protocols Executes server-side programs (such as CGI scripts or servlets) that perform certain functions.
HTTP
HTTP Basics n n n HTTP is a request-response oriented protocol. Parts of an HTTP request q Request Method q URI q Header Fields q Body HTTP response contains q Result Code q Header Fields q Body
HTTP Request Example Request parameters etc
Request Parameters n Request can also contain additional info in the form of parameters q In the URL itself as a query string http: //www. gmail. com/register? name=ali&state=punjab q As part of the request body n Shown earlier in the diagram
HTTP Response Example
HTTP Response Codes n Codes fall into five general categories q 100 -199 n q 200 -299 n q Values in the 300 s are used for files that have moved and usually include a Location header indicating the new address. 400 -499 n q Values in the 200 s signify that the request was successful. 300 -399 n q Codes in the 100 s are informational, indicating that the client should respond with some other action. Values in the 400 s indicate an error by the client. 500 -599 n Codes in the 500 s signify an error by the server.
Common HTTP Response Codes n 200: means every thing is fine. n 404: Indicates that the requested resource is not available n 401: Indicates that the request requires HTTP authentication 403: Indicates that access to the requested resource has been denied n n 503: Indicates that the HTTP server is temporarily overloaded and unable to handle the request
Server Side Programming
Static Pages 1 - Request file 2 - Retrieve file 3 - Send file
Example: Static Page
Dynamic Pages 1 - Request service Do Computation Generate HTML page with results of computation Return dynamically generated HTML file
Why build Pages Dynamically? n The Web page is based on data submitted by the user q n The Web page is derived from data that changes frequently q n E. g. results page from search engines and order confirmation pages at on line stores E. g. a weather report or news headlines page The Web page uses information from databases or other serverside resources q q E. g. an e-commerce site could use a servlet to build a Web page that lists the current price and availability of each item that is for sale Course Registration System
Course Registration System
What is Server-Side Programming (SSP)? n Technologies for developing web pages that include dynamic content. n Can produce web pages that contain information that is connection- or time-dependent.
Dynamic Web Content Technologies Evolution (only figure) CGI (in C) (java, C++) Speed, Security Servlet (Java) Template (ASP, PHP, CFML) complexity JSP
Web-Based Enterprise Applications in Java Figure shows a simplified view of one application and its layers.
Java Web Application Technologies (Presentation/Web Tier)
- Slides: 26