|
|
Network fundamentals
CHAPTER #
7
Server
side scripting
|
HTTP Gateway
- The way or method
of handling the user request from an HTTP client.
- E.g
- Common Gateway
Interface (CGI)
- Server Application
Program Interface (SAPI)
- Sever Side Includes
(SSI)
Client side Scripting
- Scripting languages
such as JavaScripts and ActiveX are available which are embedded
with the HTML tags to web page dynamic.
- Script languages
are shares the work load with the server ensuring effective
processing and bandwidth use.
- If too many client
side scripts are used,it will result in a increased file size
and hence increase the download time
- Direct access for
the client to the data involves security risks.
- If data to be accessed
resides in the client like the local time,type of server, client-side
scripting is preferred.
- If the data resides
in any place other than the client, then server-side scripting
is preferred.
Common Gateway Interface
- Simple general gateway
- The client sends
the request (e.g a form) to the server, and the server evokes
a program (e.g server-side scripting written in "Perl") based
on the client request, get the results ( e.g an HTML page) and
sends it back to the client to display on the users monitor.
- CGI can be written
in any language like Perl, C++ etc.
|
Merits
of CGI
|
Demerits
of CGI
|
- Proven method
- Cross platform
functionality ( As normally written in interpreted language
like Perl or JavaScript, no compiler required.)
|
- A popular
web page, powered with CGI can cause overload the server
processor as it launches a program every time an user
requests.
- Hackers can
use CGI to intrude in to the system.
|
Alternative to CGI
- Server Programing Interfaces
Server
Application Programing Interfaces (SAPI)
|
- SAPI reduce
the amount of processor overhead (CGI demerit) by using
dynamically loaded object library.
- A potential
problem with this type of gateway is to limit to a single
company's product.
|
|
Internet
Server Application Programing Interfaces (ISAPI)
|
- Microsoft
proprietary gateway.
- Supports only
Microsoft servers.
- Uses VB Scripts
and JScripts
|
|
Netscape
Server Application Programing Interface (NSAPI)
|
- Netscape proprietary.
- Supported
on Netscape Servers.
- Uses JavaScript
|
Alternative to
CGI - Scripting solutions
The three main scripting
solutions available are
- ASP Active Server
Pages from Microsoft.
- Live Wire from Netscape
.
- Allaire Cold Fusion.
| ASP |
- It is an HTML
page with special codes embedded.
- An ASP page
has .asp extension.
- Only Microsoft
Servers recognizes the ASP.
- The server,
as it receives the request for a ".asp" page, find for
all embedded commands and executes them and send the resultant
HTML document to the client.
- Codes are
written using VBScript or JScript.
- Runs only
on Window platform. But if you want to use it in any other
OS, a third party product called chili soft is required
- ASP is browser
independent.
|
| Server
side Java Scripting |
- Netscape's
equivalent to ASP.
- Only Netscapes
servers support SSJS.
- Runs on many
platforms.
- Coded with
JavaScript.
|
| Java
Servlets |
- Servlets are
pieces of Java source code that add functionality to a
web server in a manner similar to the way applets add
functionality to a browser.
- It can operate
on deferent platforms.
|
|
|