[NTLUG:Discuss] OT:Java Server Pages

Stephen Davidson gorky at freenet.carleton.ca
Fri Apr 21 07:51:33 CDT 2006


Tom Tumelty wrote:
> Do any open source alternatives to Sun J2EE SDK exist ? I have found in the
> gnu compiler collection, gcj which is incomplete, and kaffe which i think is
> also incomplete, I do not think either of these handle Java Server Pages
> anyway. I am particularly interested in using Java Server Pages and GPL
> license or simular.
>
> Thanks for your help,
> Tom
>   
Hi Tom.


I have noticed that some of the emails address various parts of your 
question, but none really give details, so here goes. This answer may 
jump around a bit, but I have not had my morning coffee yet (sorry).

Java is based around the Java Virtual Machine (JVM), which in theory 
works by executing a common set of platform independent byte codes (the 
old style "Interpreted").  Today, running in this mode is called 
"Client-Only" mode, and is NOT the default.  Around the turn of the 
millennium, IBM figured out how to stick a platform specific compiler 
into the JVM, and a few years back, IBM & Sun work jointly figured out 
how to stick a Runtime Optimizer in as well.  These two breakthroughs, 
as well as some other minor stuff, now allows Java to normally run as 
fast as well-written C for any platform.  In some cases, much faster for 
some stuff.  Java has not been a slow language for some time.  Btw, the 
JIT (Just In Time Compiler) and the Profiler/Optimizer and the ready 
availability of their sources when needed is what has been giving the 
Open Source implementations of Java enough competition to stifle their 
development.  Sun is doing open development of Java, and starting with 
5.0 (just released), interested Java Developers can contribute directly 
to the Java Project.

Besides, GNU, others that have Java Implementations that they distribute 
are BEA & IBM.  There are others as well, but these two Standard Java 
Implementations are perhaps the most widely distributed outside of 
Sun's, and are probably the best known.  IBM is more general purpose, 
and can be argued to be better than SUN, but BEA's JRockit is targeted 
specifically for high-demand applications, such as WebServers.  Neither 
are free to redistribute, unlike GNU, but both are much more up to date 
and feature rich.  This is one time where Open Source has not caught up 
yet with the corporations.

In addition to Standard Java, there are three other major categories 
(and one minor -- but I think getting involved with that category of 
Java would not be the wisest move);

    * Card Java (CVM) -- Runs your Smart Cards, such as your Credit
      Cards - generally has 16K Ram.
    * Micro Java - for Cell Phones, PDAs, etc.  The VM in question is
      40K, and will run with 128K Ram, although 512K minimum is recommended.
    * Enterprise Java (aka J2EE) - Built on top of Java Standard -
      offers default implementations and templates for distributed
      applications.

J2EE, which is what is basically being asked about here, is a 
Distributed programming framework, implemented in Java, with RMI-IIOP, 
JNDI, Messaging, and several other technologies at its core.  This was 
designed as a base framework (and there have been several other 
frameworks built on top, Spring and Expresso being two that spring to 
mind -- sorry for the pun) for Abstracting away the details for 
implementing a Distributed Application capable of taking on high loads.

The Servlet Specification, one part of the J2EE specification (btw, 
this, and most if not all of the component technologies of J2EE are all 
actually independent from J2EE -- all the J2EE spec does is say 'This is 
a standard.  With this version of this Standard, these versions of these 
other standards must be implemented and will be supported'), and later, 
the JSP specification, simply specify how to implement objects that a 
Servlet Container can use to respond to WebBased (normally Http) 
requests.  One thing about a specification based on the JCP (Java 
Community Process), there must always be a reference implementation.  
There is nothing that says the reference implementation must be fast, 
easy to use, or efficient.  I think that might be why Tomcat was chosen 
as the Servlet reference implementation -- the Open Source folks have 
been doing a better job at keeping up with the JCP for Java Based 
technologies than the Corporations.  (I dunno, maybe the Open Source 
crew figured since they could not keep up with the JVM, they would go 
for the Java based techs?  Makes sense to me, anyways.  Works out to be 
a really effective and usually a really nice symbioses).

In regards to Servlet/JSP containers, my personal preference is for 
something called Jetty.  http://www.mortbay.com for details.  Its Open 
Source, full featured, fast, and small enough to fit in an older PDA.  
Like Tomcat, it will also run as a standalone.

Since both Servlets & JSP are standards, there are many applications (in 
this called, called Containers), that will implement them, with Tomcat 
from Jakarta probably being the best known of the Open Source versions.  
Jetty, IBM, Oracle, BEA also have (or are) implementations.

Java  Server Pages came about as people wanted the ability to put calls 
to Java in a WebPage, but did not want to mix Java and HTML (something 
which we, as Java/J2EE Developers, had painfully discovered to be a very 
bad idea -- I have seen and had to clean up some of the messes in 
question).  The JSP specification, and later the Tag Libraries, JSTL, 
and JSF spec's were starts to the answer to this, and have done major 
good in their current forms.

If you want more details, feel free to contact me, or post either here 
or the to Lists at the DFW JavaMug or J2EE Sigs.  (see http://javamug.org)

Regards,
Steve

--
steve at j2eeguys.com



More information about the Discuss mailing list