JSP Insider - http://www.jspinsider.com

News - Articles/Tutorials/Code/Reviews - JSP/Servlet Hosting Companies - Links

JSP Buzz 02/13/2001 - The JSP Matrix

***** IN THIS ISSUE ************************************************** 
News
1:J2EE Enterprise Edition 1.3 Beta Release
2:Xalan 2.0 Released

Rambles 
1:The Great Marketing War of 2001
3:XSL Helpers
4:Quote of the Moment

Links 	
1:JSP: Buffered Output and Session Management
2:FAQTS
3:Profusion
4:Process JSPs Effectively with JavaBeans
5:RetroGuard Obfuscator
6:OpenSymphony
7:JSP Powered Airplanes
8:Why Use Free Software
9:Walking through Your Web Site
10:Web Developers Conference 2001

Reviews
1: Sun Forte Internet Edition

Main Topic 
1:JSP from a Different View Point

Like this newsletter? Tell a friend about the JSP Buzz!


================================================================
              THE LATEST NEWS
================================================================
1) J2EE Enterprise Edition 1.3 Beta Release (2.7.2000)

To download this release you need to create a free account. 
This release of J2EE contains all the final proposed versions of
Servlets 2.3,  JSP 1.2 and  Tomcat 4.0 container.  Major improvements 
to EJB are also included in this beta release. Overall this is for
J2EE programmers and not the average JSP developer. 


2) Xalan 2.0 Released  (2.2000)
Speaking of new tools, Xalan 2.0 has just been released to the public.
Xalan is a Java-based XSLT processor.  It implements the W3C 
recommendations for both the XSL Transformations (XSLT) and XML Path 
Language (XPath). Xalan 2.0 has been simplified and redesigned to make 
it easier to use for the Java developer. Xalan has support for SAX 2, 
DOM level 2, and the XML Parsing 1.0 Java API. 

================================================================
                   Rambles by Casey Kochmer
================================================================

***************** The Great Marketing War of 2001 *****************
This ramble starts off as a news item for the Buzz.

The Java Platform and Sun ONE  (2.5.2001)
This is Sun's vision for the future and the competition to .Net.

It quickly becomes a ramble and my opinion on the whole mess
going on between Microsoft and Sun. Quite honestly, I am tired of all the 
posturing from both Microsoft and Sun. Reading this press release is one 
big yawn. The Microsoft press releases of late have been even worse. The 
O'Reilly site summed it up best when they said:

"Seventy percent infomercial, 20 percent Microsoft bashing, and 10 
percent solid infrastructure overview."

All in all, I say let both Sun and Microsoft yammer away. All this hype 
is targeted for long term goals. This really means all this posturing 
right now is all about getting mind share and not reality. For the 
average developer, it means business as usual. We are still using the 
tools we already have at our disposal and still building the current 
generation of products. Over the next few years as the newer tools are 
released we will test them, use them and then pick the ones we need to 
build the applications that power our ever more interconnected world. 
However, all of these press releases are just 'hype.' The only problem 
is that while hype = 'zero' for us as developers, hype ='big dollars' 
for the companies driving the media machine. This means we are due for 
more posturing from the major players. I can summarize it all in two 
words: "Oh well."

Now I can go back to building my JSP pages. Oh and did I mention I am 
currently building this really kewl XML / XSL reporting system that I
will port to work for both ASP and JSP? Now that matters! Real systems
by real people and I smile since it works with no hype!

Ironically this is what Sun is trying to say. We have the tools you 
need now to build the systems you need now. But I fear their message is 
getting lost in this marketing war. So I shrug and go back to my coding 
and say:  "Oh well."


************************* XSL Helpers **************************** 

After having built reporting systems in almost every major programming 
language known to man, I am starting to write what I hope will form the 
basis of the last system I will have to write. The reason: I am building 
it as a generic XML-based system.

To this end, XSL plays a key role. I thought I would share a list of key 
resources I compiled to aid in my work.


GETTING STARTED USING XSL

The easiest way to test and use your XSL is with IE 5.5. However, most
copies of IE 5.5 are using an out-of-date XSL model. You can very easily
upgrade IE 5.5 to be current.

Second, some helpful examples are available to download 

Then to find answers to common questions.

If you need answers to more complicated questions use the following archive.

If you need to ask a new question then visit the list at Mulberry Tech.

For a good reference book try "The XSL Companion" by Neil Bardley.
(Look for a review on the jspinsider.com site later in the month.)

For Java code try these resources:
JDOM
Xalan
JAXP

Hopefully, by the end of the summer I will automate the Buzz to be JSP/XML/XSL
based so it will be easier to produce both the newsletter and site versions!

If enough JSP Buzz readers express interest in this topic some additional 
articles on the overall JSP / XSL / XML / HTML process will be compiled.
So, if you'd like to see more, drop an email to us at the Buzz.


********************** Quote Of The Moment ************************* 

"The most likely way for the world to be destroyed, most experts agree,
is by accident. That's where we come in; we're computer professionals.
We cause accidents."  Nathaniel Borenstein


================================================================
              Links of Interest
================================================================
[Article] JSP: Buffered Output and Session Management
(Duane K. Fields and Mark A. Kolb 2.9.2001)
An excellent overview on how the JSP page communicates with the client
browser, this article reviews the timing and implications of the HTTP
communication that we must address in building web applications. This
article also reviews some basic facts about using the session object.
The article is actually an excerpt from the book, "Web Development with 
JavaServer Pages".

[Site] FAQTS 
This site provides a nice knowledge base for finding answers to your 
questions. I recently encountered a DHTML problem for which I couldn't 
find an acceptable answer. Then a friend showed me this site and up 
popped the answer. While FAQTS doesn't have much JSP information, it 
is a good link to have for JavaScript, DHTML and HTML questions you 
might encounter while programming in JSP.
 
[Search Engine] Profusion
As JSP programmers, research on the internet is vital tool for solving 
problems. It's how I became addicted to meta search engines. Since a 
meta search gathers data from multiple search engines, the results tend 
to give a better representation of the subject of your search. To date, 
MetaEureka has been my search engine of choice. However, Profusion has a 
good chance of becoming my first choice. It has many additional features 
which make it a powerful tool for performing research. Worth checking out.

[Article] Process JSPs Effectively with JavaBeans (Milan Adamovic 1.19.2001)
This article performs a walkthrough on one possible methodology of 
building a JSP web site. The article explores building a template-based 
version of Model II JSP web pages. I personally found the article a bit 
hard to read. However, this is a complicated topic and this article has 
been the best walk thru I have seen for building this style of JSP 
framework. 

[Open Source Product] RetroGuard Obfuscator
While no system can fully protect your Java code, Java bytecode 
obfuscators can make it harder for others to "borrow" your code without 
authorization. This tool has an additional benefit of reducing the size 
of your final class files. So this tool can be of great benefit when 
space is of critical importance (such as download times for big applets). 
RetroGuard is an open source product under the Lesser GNU Public License.

[Open Source Product] OpenSymphony
This is an open source J2EE component project with various components 
you can use along with JSP. From my point of view, the most interesting 
component is OSCache. This is a JSP tag library and set of classes used 
for dynamic caching of JSP content. You can perform persistent caching 
to disk.  Also you can create special fail-over situations. For example, 
the authors state, "If an error occurs like your dB goes down, you can 
serve the cached content so people can still surf the site almost without 
knowing."  My favorite feature is the ability to cache sections of JSP 
pages. Overall, a very nice open source project.

[Fun Site] JSP Powered Airplanes
This will prove what you can accomplish with JSP is limitless.  To make 
this a JSP link, first print out a page from your JSP project. Then using 
the print out follow the instructions from this site. Before you know it, 
you have your own JSP powered airplane!  Ok, I know it's off topic, but 
I used to be an engineer at Boeing and I use to help build planes. So it's 
fun to re-live the days of my building paper airplanes. Besides, you will 
be the only one in your office with a JSP powered airplane!

[Article] Why Use Free Software?  (Alain Lefebvre 8.2000)
As the readers of the JSP Buzz know, I am an avid supporter of open 
source software. This is a nice article examining why open source works.
The goal of this article is to respond objectively to commonly asked
but important and legitimate questions about open source. A nice follow 
up article may be found at the same site.

[Article] Walking through Your Web Site  (David Blakey 11.29.2000)
A nice piece on how to examine your site by performing a walk about.
While the techniques discussed are meant for larger generic web sites, 
they are equally important for single task web applications.  

[Conference] Web Developers Conference 2001 (June 11-15, 2001, Denver)
This general web application development conference is a great chance 
to see other server-side technologies at work and learn more about JSP.  
Casey & Jayson will be there too!  Please look them up and attend one 
of their JSP presentations. One of our presentations includes a half 
day JSP starter class.


================================================================
                           Reviews

These reviews are not sponsored and are not advertisements. They 
are just my observations of various software packages I have been
evaluating. 
================================================================

[Java IDE] Sun Forte Internet Edition  (Sun)
I have been using the Internet Edition of Forte for the past month.  My 
first impression is favorable. It has solid JSP support. It is easy to 
use and offers all the features I need to get my programming done. The 
biggest drawback is that it is slow on my 300 MHz 128meg laptop. So I 
still use Jedit when I want to make quick edits.  The only feature I miss 
is that you can't perform a simple "save as" function on a file.  This 
lack of being able to resave your file to a new file is quite odd. (You 
may, however, rename your file.)  Overall, I would give Forte a big 
thumbs up.


================================================================
                     MAIN TOPIC by Casey Kochmer
================================================================

**************  JSP from a Different View Point  *************** 
WHAT IS JSP? 

While this seems like simple question it isn't and surprisingly the 
answer often given really isn't the proper answer.

Properly defined, JSP is both a matrix and glue to hold together 
and execute many technologies from the server. JSP is the central 
intersection upon the server where all the work gets coordinated by
the programmer.

A problem arises from the fact developers remake JSP to fit their 
understanding. Our understanding is rooted in our initial training. 
The six common backgrounds of programmers entering the JSP field 
include:

1. Java.
2. ASP / PHP.
3. HTML web design.
4. Client server programming.
5. Mainframe.
6. Starting cold turkey (effectively this ends up being a combination 
   of 1 & 3).


Each of these backgrounds brings their own prejudices and, as a result,
limitations to the way a developer builds a JSP application. It isn't
bad from the aspect, as programmers, we develop from our strengths. 
The problem comes from the fact our JSP design then tends to become 
unbalanced in the final implementation. On many projects this may not be 
noticed since the application is simple enough that it performs well. 
However, as web applications get more complex and speed becomes more 
critical, this can quickly become a critical flaw.

Ideally, a JSP application is a blend of many technologies and a 
balance of distributed processes. The main function the JSP central
piece is performing the traffic maintenance among all the processing.


EXAMPLES OF HOW BACKGROUND CAN AFFECT THE FINAL DESIGN

A programmer with a Java background:
Finds the matrix nature to break object orientation and as a result under 
utilizes the ability to script within the JSP page. This usually manifests 
itself in overbuilding Model II JSP applications when a simple Model I 
system would be enough for the application. Also, complicated backends 
are developed when a simple object library would be enough to support 
the application. As Java programmers we love to build Rolls Royce object 
libraries, but more times than not the rugged Jeep wins the day.  

A programmer with an ASP background:
Finds the matrix nature of JSP familiar but will not be used to building 
object oriented systems. As a result they may build Model I systems which 
really should have been Model II applications.  Also, JSP is not ASP, no 
matter how similar they look, which means JSP can be a frustrating 
learning experience for many ASP programmers. People enter JSP thinking 
that its just a quick translation only to find features which look 
similar but in reality are quite different. This often shows in the fact 
that ASP programmers will have problems with the threading model of JSP 
since within ASP threading is usually not an issue. The end result is 
longer development times for the project.


WHAT DOES THIS ALL MEAN?

We need to be careful in our designs. Finding balance is something that
takes both experience and time. Don't expect to learn it overnight. It 
means that as JSP programmers we should always be open to trying and 
experimenting with new techniques since there will almost always be 
many different optimal solutions. Strange thought isn't it?  

For example, who says a JSP application should only be Model I or 
Model II?  I believe that many JSP applications should be viewed as 
a grouping of several smaller applications. A single JSP application 
could consist of a mixture of Model I and Model II. Why not? JSP is a 
distributed web application.  Many systems  could be built as a collection 
of modules.  Granted, modules will share reusable code and many modules 
will share a framework. But that is not a problem. By partitioning an 
application into smaller systems it is possible to achieve a more flexible 
overall application. 

My point is don't limit your thinking to past systems. Always look at 
your design and search for gaps within the design. Look for new 
technologies you haven't used yet. After all JSP is a matrix and you can 
plug into that matrix almost any technology that exists or will exist. 
Thinking this way isn't easy to do, but the benefits of doing so are huge. 
For example: one gap many projects still have is not using XML yet. It is 
now very easy to use XML for creating reports. If the customer has an XML 
browser, great! Send them the XML data and XSL style sheet, then let the 
client perform the work of running the report. If you can't do this, then 
on the server smash the XML and XSL data together and send the result to 
the client.

CONCLUSION

It is the matrix nature of JSP which some developers feel is too 
complicated. I agree that because of these multiple layers that JSP isn't 
for every project. However, like a composite material, it is this matrix 
nature that places JSP among the strongest and most flexible of the server 
side solutions in the marketplace. To not use it for these strengths
is poor design practice. Being a JSP programmer means having the great 
ability to use many different technologies at the same time.  Use this 
flexibility for the benefit of your project.

================================================================
                           SUBSCRIPTION
================================================================
You may unsubscribe from or subscribe to this newsletter by going to:
http://www.jspinsider.com/jspbuzz/index.view

Browse all of the JSP Insider source-code.

Questions or comments? Contact support@jspinsider.com.