A Look Inside JavaServer Pages
By Ethan Henry
With modern enterprise applications moving from 2-tier towards 3- and n-tier architectures, developers are looking for different ways to deliver applications and data to users. The traditional thick client, consisting of a full-blown application residing on the local computer, is difficult to distribute and keep up to date. Web-based clients provide an excellent alternative for intranet and Internet enterprise applications, even outside of the traditional domains for Web-based apps, like electronic commerce and HTML content distribution. The new JavaServer Pages (JSP) API, part of the Java 2 Enterprise Edition (J2EE), gives Web and Java developers a simple yet powerful mechanism for creating these sorts of applications.
JSP provides developers with two important abilities. First, it provides the ability to access remote data via mechanisms like Enterprise JavaBeans (EJB), Remote Method Invocation (RMI), and Java Database Connectivity (JDBC). Second, it lets developers encapsulate and separate program logic (Java code) from the presentation (HTML tags), to help maximize code reuse and flexibility. This separation of logic and presentation is a major advantage over other Web application architectures, like Java servlets and CGI scripts.
In this article, I'll present an overview of the technology, along with some examples that demonstrate dynamic page generation and database access that show off some of the benefits of JSP.
How JSP Pages Are Executed
To support JSP pages, the Web server has to be appropriately configured.