Although rich web sites and applications have become the norm
in recent years, they can still be difficult to develop, maintain, and expand.
Many of the challenges stem from the schism between client and server components.
libraries, images, and whatever other files that are to be downloaded to the
browser. On the server, you need a listener to process requests, fetch resources
or information, and manipulate them so that they can be sent back to the client.
This is usually accomplished using XML, JSON, or HTML-Formatted text, which
is sent across the wire using Ajax. There are a number of competing technologies
to choose from here. Depending on your traffic, hardware, O/S, bandwidth,
IT expertise, and numerous other factors, there is a technology for every
taste and occasion. Popular server-side languages at this time include PHP,
Java, and .NET, to name only a few. There is presently a ServerJS movement
whose goal is to eliminate the gap between client and server. Exponents
than can process the code. One such server is called Jaxer. Developed by Aptana,
Jaxer is an open source Ajax web server for building rich web pages and applications
Writing code for Jaxer is the focus of this article.
on server-side and is therefore not downloaded to the browser. This term is
short). The first implementation of SSJS was Netscape's LiveWire, which was
included in their Enterprise Server 2.0 back in 1996. Since then,
a number of other companies have followed suit in offering an alternative
to the usual server-side technologies. One of the biggest players in the field
is now knows as "classic" ASP. Along with the most common VBScript
all you had to do was set the
LANGUAGE attribute in the opening script tag:
Since the code runs on the server, what is sent to the client
is the output of the script rather than the source code. Hence only the tags
produced by the
Response.Write() functions are found in the page source:
- The same code can validate data on both the client (for immediate user feedback) and on the server (for security), so validations never get out of sync.
- The same code can prepare both the HTML DOM server side and modify it client-side, when the user changes the data or it's refreshed from the server.
- Using the same code on both the client and the server, developers have fewer technologies to learn and stay on top of, and fewer parts of the application or site to maintain.
The Aptana Jaxer Server
Jaxer is not a stand-alone server, but rather, acts as a plug-in
to another server such as Apache, Jetty or Tomcat so that it can handle the
traffic load. Jaxer provides the server-side DOM and API processing for pages
served by the web server before delivering the results to the browser.