Welcome to JOT Servlets
Welcome to JOT Servlets, the
web component framework that cuts through
the complex layers of J2EE technologies.
With JOT Web Components, web designers and Java programmers
can use the skills they already have to create dynamic content
without JSP, JSF or complex XML programming tags.
The JOT Servlets MVC architecture
provides a clean separation between Java object oriented
programming with JOT Beans and web page design with
JOT Templates. The JOT Web Components framework
renders rich content from composite views. Zero configuration
deployment means no special XML configuration files are required.
JOT Servlets work with any J2EE application server, including
WebSphere, WebLogic, JBoss and Tomcat.
About JOT Servlets
JOT Servlets is a J2EE rapid application development
framework for dynamic content web applications.
For instance, ecommerce shopping cart web pages that include
database information are familiar examples of dynamic content applications.
![]()
JOT Servlets Framework:
Web designers and programmers use the JOT Servlets framework
to create web applications. With Jot Servlets,
dynamic content is rendered into web page templates without
JSP, JSF or complex XML programming tags.
JOT Web Components are content building blocks
that are combined to any nesting depth to render composite views,
including tiled layouts and web portals.
JOT Templates are standard web pages (HTML, XML, WML)
with tokens for dynamic content and server-side scripting.
JOT Tokens use server-side Java objects to render dynamic
content. For example, JOT.customer.lastName renders the
lastName property of the customer object.
JOT Views is a dynamic content rendering engine
for use with any Java Servlet or JSP page.
JOT JSP Tags are custom tags for rendering
dynamic content web components on JSP pages.
JOT Servlets System Architecture
JOT Servlets produce dynamic web pages in response to HTTP
requests sent to a web server. A JOT Servlet renders dynamic content
with a JOT Template
web page. With JOT Views,
any Java Servlet or JSP page can use this architecture to render JOT Web
Components.
JOT Template tokens render dynamic content with the properties of
server-side Java objects (JOT Beans, J2EE objects, and POJO's -
plain old java objects). JOT Web Components
render dynamic composite views, including tiled layouts, with nested
JOT Templates. JOT Iterators render dynamic
tables and lists using Java Collections, JDBC database
ResultSets, and other sets of objects.
In this architecture, JOT Beans mediate between the request/response
domain of the Internet and the back-end domain of enterprise systems.
JOT Beans interface with view-independent business objects
that define a clean separation between the web application layer and the
enterprise infrastructure layer.
See the Sun system architecture
blueprints to learn more about web architecture principles.
JOT Servlets Framework Design Goals
The JOT Servlets web component framework presents a simple
and powerful paradigm connecting the disparate presentation
media of web page designers to the software engineering
domain of Java programmers. Designers working with web page
tools are concerned with content and human interface issues.
Java programmers are concerned with software objects,
databases, and enterprise systems.
![]()
Design Goals of JOT Servlets Framework:
Separate the web page design process from the web tier
programming process, allowing each activity to proceed independently.
Maintain 100% compatibility with web page editors and web
design tools without requiring that designers learn programming logic
or non-standard tags.
Leverage standard Java constructs such as Java Servlets
and Java Beans without imposing a steep learning curve for yet another
specialized programming paradigm.
Provide a flexible and minimalist servlet API that does
not restrict software architecture options.
Tiled Layouts
Tiled Page Layouts:
A tiled design has a master template that arranges the layout of a page
in sections called "tiles". One such tiled layout sets the
look-and-feel for many pages or an entire site. For instance, the
master template can layout a header tile and a menu navigation tile for
every page. The completed pages are rendered with dynamic content in the
body tile position. This allows a change in one place to change
many pages and reduces copy-and-paste repetition. Tiled layouts are also
useful for portal designs where the content of the tiles is
composed dynamically.
A JOT Template tiled page layout renders JOT Web Component content
into the tile positions. In the following example the
MyAppLayout.html master template has header,
body, and footer tiles. The JOT.Body token
renders dynamic content into the body tile.
The following CustomerPage template sets the title and body properties
before rendering the above tiled layout. The CustomerInfo component
is the content of the body tile. The JOT.Title token assigns
dynamic content for the header tile.
More elaborate tiled designs have tiles arranged in columns
and rows. With JOT Web Components, tiles can contain
sub-layouts to any nesting depth. The JOT.Repeat token can be used
for portal designs that have a variable number of content tiles
depending on the user.
<html>
<!-- - - - - - - MyAppLayout.html - - - - - - -->
<head>
<title>JOT.Title</title>
</head>
<body bgcolor="#CCCCFF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<!-- header tile -->
<tr><td>JOT.Content(/webpages/MyAppHeader.html)</td></td>
<!-- body tile -->
<tr><td>JOT.Body</td></td>
<!-- footer tile -->
<tr><td>JOT.Content(/webpages/MyAppFooter.html)</td></td>
</table>
</body>
</html>
<!-- - - - - - - CustomerPage.html - - - - - - -->
<!-- Include property default settings -->
JOT.Content(/webpages/MyAppLayout.defaults)
<!-- Set properties for the Customer page -->
JOT.Title=("Customer Information for ", JOT.LoginName)
JOT.Body=(JOT.Views.Component(com.myapp.CustomerInfo,/webpages/CustomerInfo.html))
<!-- Render the tiled layout -->
JOT.Content(/webpages/MyAppLayout.html)
Java Servlets API
Java Servlet technology is a Java standard for developing HTTP web server
applications. The Java Servlet API has been called a "better-CGI-than-CGI",
because servlets replace server-side programs that in the
past would have been CGI scripts written in a language such as Perl.
Servlets have a significant performance advantage relative to CGI,
because a servlet is created and loaded once by a web server,
while CGI scripts are restarted on every web page access.
Java Servlet programmers developing web applications gain the advantages of
programming in a feature-rich object oriented language. Servlets naturally
leverage other Java technologies such as Java Beans, and interface with
middleware protocols, including Enterprise Java Beans (EJB), Java Remote
Method Invocation (RMI), Java Database Connectivity (JDBC), and CORBA.
The servlet API is supported across a range of web servers (JBoss, WebLogic,
WebSphere, IPlanet, Apache, IIS, and others) and operating systems
(Unix, Linux, NT, and others). For more information about servlets,
visit the Sun Microsystems
Java Servlets web pages.
What About JSP?
JavaServer Pages (JSP) is an extension of Java Servlet technology that
provides one approach to dynamic content generation. The JSP acronym
suggests it was inspired by Microsoft's ASP (Active Server Pages). Classic
JSP employs Java as the server-side web page scripting language, whereas ASP
uses BASIC for scripting.
The Problem with Servlets:
Java Servlets provide an elegant interface for handling the HTTP Internet
protocol. But servlets do not provide a reasonable way to generate
web pages. A bare bones servlet generates HTML with Java println
statements one line at a time. This approach to embedding
HTML within Java is a cumbersome way to lay out a web page.
Programming in JSP:
JSP reverses the paradigm by embedding Java within HTML.
Java scriptlets are embedded in JSP pages with non-standard
tags (neither HTML or XML). But experience has shown that mixing Java
and HTML in this way results in web pages that are difficult to design
and maintain.
A newer JSP approach is to use tag libraries that hide Java code
behind XML tags. JSP Standard Tag Library (JSTL), Expression Language (EL),
and Java Server Faces (JSF) have transformed JSP into a feature-rich
XML programming language reminiscent of Awk or Perl.
Effective use of these JSP programming features requires training and
experience with object-oriented software concepts. This evolution of JSP
is similar to past attempts at 4GL (fourth generation) languages for
non-programmers. Instead, as happened with 4GL's, a new language has
emerged that requires a new type of specialized JSP programmer.
Problems with JSP:
There are many server-side approaches for generating dynamic
content (see comparisons).
JSP's evolving architecture has created layers of technology for programmers
to grapple with (Java, and scriptlets, and tag libraries, and expression
language, and Struts, and now Java Server Faces).
A central concern is the failure of JSP to separate page
layout (presentation) from programming logic. JSP has replaced Java
scriptlets with an equally complex expression language and XML programming
tags. Java Server Faces (JSF) continues this trend of moving
programming syntax into the web page, intermixing programming language
constructs with the presentation view. Problems with JSP have been
discussed elsewhere (see
Hunter).
JOT and JSP Examples
There are many server-side programming approaches to generating dynamic
web content. This example shows four ways to use Java Servlets to create
a list of names on a web page. For more information see this link regarding
problems with JSP.
Which approach adds the least programming code to the web page?
|
1. Java Servlet (println statements) :
|
HTML embedded in Java: The servlet writes the response with HTML hardcoded in println statements. |
|
2. JSP Scriptlet (Java) :
|
Java embedded in HTML: The scriptlet is pure Java code inside a web page between <% and %> tags. The server transforms the JSP page into a Java Servlet. |
|
3. JSP JSTL (Standard Template Library) :
|
JSP Programming: The JSTL version uses EL (expression language) with an XML programming syntax that includes scoped variables, operators, and object references. |
|
4. JOT Template :
|
JOT Tokens in HTML: The JOT version is plain HTML with JOT Tokens, requiring no knowledge of JSP, XML, JSTL, or EL. |