Jumpstart into the Web technologies: <- Prev. Start Contents References Home Next ->
Server-Side technologies (Application Servers)

  1. Overview
  2. Netscape LiveWire
  3. ASP
  4. Allaire ColdFusion
  5. Java Server Pages (JSP)
  6. Others

There is no clear definition of what is an 'Application Server' (or at least I didn't find one). The idea behind these servers is to solve the CGI problems with performance, session states, database connection pooling etc. Application Server is a middleware, it used as a middle tier in a classic tree-tiers application model, browser is a GUI client and a database, to which application server is connected is a back-end.

Here is the list of the main features which usually can be found in the application servers:

Some reviews of different application servers can be found at ServerWatch - Application Servers.

Below is a little bit more detailed description of some application servers. Of course it's far from being a full list, there is probably at least 40 commercially available application servers.


Netscape LiveWire

LiveWire is the database connectivity library for the old netscape server, wich was the first application server, so many others used the similar model. The way it's working is the following: You write a regular html pages, but inside them incorporate between the <SERVER> tags the JavaScript code, which will be executed on server before page is send to the client. Using the JavaScript application compiler, these files are compiled together to create the .web file, which contains the application.

You can set and retrieve the session variables, which will be preserved accross the session. There are functions, which allows to do the database connection pooling and access.

Note, that there were no new versions of this, today's netscape application server is using totally different (mostly Java) technologies. But I think it was worth to mention because it was the first one.

Example:
Assume we want to ask user his name and produce the next Web page saying 'Hello Joe!'. Let say the page ask.html prompts user for his name. Here is how the code in Server-Side JavaScript will look like:

...
<SERVER>
if (!request.name)
  redirect('ask.html');
</SERVER>
...
<H2> Hello <SERVER>write(request.name);</SERVER> </H2>

More on this technology can be found at Netscape Server-Side JavaScript documentation.

Go back to top

ASP

Microsoft ASP using the similar technology, but instead of JavaScript it's using as a default language Visual Basic scripting edition (VBScript), but you can also choose JScript (MS version of JavaScript), although most of the places use VBScript. All ASP code is enclosed between a <% and a %> tags. All ASP pages should have extension .asp. ASP runs on MS IIS and PWS (Personal Web Server) and there are ports of ASP to other platforms by third party vendors.

Example:
Same example as in the previous chapter, but written with ASP:

....
<%
IF NOT Request.Form("Name") THEN
  Response.Redirect("ask.html")
ENDIF
%>
<H2>Hi <%=Request.Form("Name")%> !</H2>
....
The funny thing is that I didn't find any good ASP tutorial on the Web, in the best case it was a 2-3 pages overview... Try to check for more info ASP overview from Microsoft Web site. If you get 'Microsoft JScript compilation error' don't give up, I've got it 2 out of 3 times on each page, just reload it and may be you'll get lucky (I guess it's a nice example of this technology) :-)).

Go back to top

Allaire ColdFusion

Allaire ColdFusion uses the different approach. Instead of embedding some programming language into the HTML pages it uses its own proprietary ColdFusion Markup Language, or CFML, which is a tag-based language. It has about 100 build-in tags to access the variables, databases, build conditions etc. In addition it allows you to create the custom tags, which can be created with CFML or using C++ and CF API. Allaire Web site has a big collection of custom tags submitted by developers.

The plus of this approach is that it's very easy to learn even if you are not a programmer. The minus is, that if you need to create a complex application, you need to use C++ which will be linked to ColdFusion server. This creates the problem, that if you have pretty big amount of code, you have a good chance of having some memory leaks in it, but since this code is running all the time inside the CF server it can easily lead to disaster (like server using too much memory and eventually crashing).
ColdFusion comes with ColdFusion Studio, which is a very nice development environment similar to their HomeSite product.

All ColdFusion files ends with .cfm. Web server (it can be apache, netscape or IIS) hands over to ColdFusion server any file which ends with .cfm. ColdFusion server processes the file (all CF tags) and sends the output (HTML) back to the Web server, which sends it to the browser.

Example:
Same example with ColdFusion will look like:

....
<CFIF IsDefined("Form.Name")>
  Hi, #Form.Name# !
<CFELSE>
  <CFLOCATION URL="ask.html">
</CFIF>
....

More info on ColdFusion can be found on Allaire Web site.

Go back to top

Java Server Pages (JSP)

The idea behind the JSP is basically the same as it was with the server-side JavaScript, with the only difference, that it's Java instead of JavaScript.

Java code is enclosed inside the <% ... %> brackets or tags like: <jsp ... />

JSP uses the similar technology as ASP, but it's based on Java instead of Visual Basic or other MS-specific language, so it is more powerful and portable to any other system with non-Microsoft Web servers.

The way JSP is working: there is a JSP server running, which knows how to handle the .jsp files. Web server (it can be any Web server, apache, netscape etc.) hands over to JSP server any file which ends with .jsp. JSP server processes the file and sends the output (HTML) back to the Web server, which sends it back to the browser.

Example
Same example with JSP will look like:

...
<%
if (request.getParameter("name") == null) {
%>
  <jsp:forward page="ask.html"/>
<% } else { %>
<H2>
  Hello <% out.println(request.getParameter("name")); %> !
</H2>
<% } %>
...
More info on JSP can be found at Sun's JSP documentation

Go back to top

Others

More references to the application servers info can be found here.

Jumpstart into the Web technologies: <- Prev. Start Contents References Home Next ->

Copyright © 2000 Sergey Gribov