JSP Tag Libraries

Скачать в pdf «JSP Tag Libraries»

By loading the extension module directly into the web server, we gain unmatched performance since invoking our extension is merely a function call. Unlike CGI, the function calls take place within a single process that is already running; namely, the web server process itself. We can also save state inside the web server address space. This allows us to save the results of expensive processing (such as objects that are slow to initialize) in a central location so that they can be shared by requests instead of being created over and over again. These two features alone address both of the major shortcomings we saw with CGI.

Server API drawbacks

Oddly enough, the unmatched performance available by writing to the web server API did not win this extension method the popularity of CGI or other extension techniques that we will discuss. It failed to catch on for several reasons:

■ Each server has a different API. This means there is no standard that can be learned once and applied across servers.

■    The extensions need to be developed in a low-level language such as C or C++. This places the extension development knowledge bar at a fairly high level.

■    A bug in an extension can often bring an entire web server down. This means extensions must be tested thoroughly and the extension developer must be an experienced developer.

The overall result is that developing a server API extension is very expensive (in terms of salaries and development time), rendering server API inapplicable for many tasks. Some other extension technique was needed. We’ll see in chapter
2 how JSP and its custom tags can be developed with far more ease than a server API extension; namely because they are written in the well known, standard Java language. This fact alone addresses all the weaknesses of an API approach since the Java is fairly high-level, strictly standard, and robust enough that a simple bug won’t blow up an entire web server, and JSP greatly simplifies the generation of dynamic content.

Скачать в pdf «JSP Tag Libraries»