









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of various server-side scripting technologies, including php, common gateway interface (cgi), and java server pages (jsp). Learn about their features, advantages, and disadvantages, as well as their differences from each other. Gain insights into their implementation and usage in web development.
Typology: Study notes
1 / 15
This page cannot be seen from the preview
Don't miss anything!










Dr Kingsley Sage Room 2R308, Chichester II [email protected] © University of Sussex 2009
A review of web technologies Some you may already be familiar with … And other not Not intending to be an exhaustive description, rather enough to know what the technologies are and where you might use them
PHP: PHP Hypertext Proprocessor A widely used open source general purpose scripting language that is especially suited to web development and can be embedded into HTML
A really simple example:
PHP test
Hello World
’; ?> Call using something like http://localhost/hello.php
A HTML form and PHP script to process it:
Your name:
Your age:
Hi . You are years old. Hi Joe. You are 22 years old.
Common : Each client and server program, regardless of their OS platform, adhere to the same standard mechanism for the flow of data between client, server and gateway program Gateway : can act as mediator between a HTTP server and any other program that can accept some form of command line input (e.g. stdin or environment variables) Interface : A standard mechanism that provides a complete environment for developers
CGI programs go beyond the static model of a client issuing one HTML request after another The CGI specification allows the information provider to serve up different documents depending on the client’s request CGI specification also allows the gateway program to create new documents on the fly e.g. generating a table of contents
JSP is a Java technology that allows developers to dynamically generate HTML, XML or other document types in response to a web client request JSP allows Java code and other pre-defied actions to be embedded into static content JSP syntax adds XML like tags, called JSP actions, to be used to invoke built in functionality Allows for the creation of JSP tag libraries
JSPs are compiled into Java servlets by a Java compiler JSP can be broken down into:
Static data is written to the HTTP response exactly as it appears in the input file JSP directives control how the compiler generates the servlet Scripting elements and variables: <% int serverInstanceVariable = 1; %> <% int localStackBasedVariable =1; out.println(localStackBasedVariable): %> <%= “expanded inline data “ + 1 %>
JSP actions (seen these before?):
A single standard for implementing and deploying Enterprise applications Central to this development model is the notion of containers Components can expect container services to be available on any J2EE platform from any vendor Containers provide standardised access to enterprise information systems e.g. relational data through the JDBC API Containers provide a mechanism for selecting application behaviours at assembly or deployment time through the use of XML based deployment descriptors
ASP is Microsoft’s server side technology for dynamically generated web pages Programming is made easier by using built in objects. ASP 2.0 has 6 objects
Most ASP pages are written using VBScript But you can use any other active scripting engine e.g. Jscript, PerlScript An example of a very simple script using the Response object might be:
<% Response.Write(“Hello World!” %>
The Base Class Library (BCL) is a library of things available to all all languages using the .NET framework BCL provide classes that encapsulate a number of common functions such as file reading and writing, graphic rendering, database interaction, XML document manipulation .NET also has security mechanisms
Asynchronous JavaScript and XML (AJAX) is a web development technique for creating interactive web applications The idea is to make web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, so that the entire web page does not need to be reloaded each time the user makes a change AJAX is a technique (really a design pattern), not a specific technology
The basic idea is to get the client doing as much of the work as possible, reducing the bandwidth requirements and thus making pages appear to load faster For example, consider an application where you have a results set with a lot of data. The HTML can be produced locally in the browser using a JavaScript application downloaded with the original first page. The client can then ask just for the data from the server and the this is then populated into HTML in the browser Generally only small requests need to be made to the server and relatively short responses are sent back Data can be sorted and stored in the browser Data format is XML
Advantages: