Sunday, May 30, 2010

Server-side Technologies CGI, PHP, Java Servlets, JSP

Server-side Technologies CGI, PHP, Java Servlets, JSPServer-side Technologies CGI, PHP, Java Servlets, JSP Denis Helic Server-side Technologies: Historical Background(1/3) Server-side = Web server side At the beginning the Web was a static information system Web servers served documents, images, etc. Static information stored on the server side (file system) No interaction between users and the Web (except browsing) (2/95) Server-side Technologies: Historical Background(2/3) There was a need for more interaction between users and the system (e.g. phone books) HTML forms Server needed to respond differently depending on values submitted by users Dynamic response by server (3/95) Server-side Technologies: Historical Background(3/3) Need to extend the functionality of Web servers Don’t add the new functionality into Web servers directly Just allow Web servers to communicate with external programs External programs generate dynamic content depending on values sub- mitted by HTML form Dynamic content forwarded to Web server Web server responds with dynamic content (4/95) Server-side Technologies: Today More

than just evaluating of HTML forms Dynamic content needed for: Sophisticated user interaction (e.g. search engines, shopping carts) Content changes often (e.g. weather forecast, news headlines) Web gateways to database-based applications (e.g. prices of products, online ticket reservations) (5/95) Communication between Web server and external programs How should Web server communicate with external programs? Passing parameters, getting response, etc. Standardized communication mechanism Standard created by Web consortium (6/95) Common Gateway Interface (CGI) CGI is a specification of communication between Web server and external programs Current version CGI 1.1 http://hoohoo.ncsa.uiuc.edu/cgi/interface.html Very general approach, can be applied for different applications Not only HTML form evaluation Web server must implement CGI specification All major Web servers do! (e.g. Apache, IIS, etc.) (7/95) CGI Specification(1/4) Environment variables System specific variables set by Web server External program reads environment variables and obtains data about client request CONTENT_LENGTH, CONTENT_TYPE, REMOTE_ADDR, REMOTE_HOST, etc. Command line Using a special HTML tag user sends a command line to the server Command line executed on the server (8/95) CGI Specification(2/4) Standard Input Used by the server to send client data to external program Standard Output Usedbyexternalprogramtosendresponsetotheserver(writeHTML to standard output) (9/95) CGI Specification(3/4) HTTP method used by the client: GET or...

Website: coronet.iicm.tugraz.at | Filesize: 229kb
No of Page(s): 95
Download Server-side Technologies CGI, PHP, Java Servlets, JSP.pdf

No comments:

Post a Comment