Java Glossary : JSP

CMP home Java glossary home Menu no menu Last updated 2004-06-29 by Roedy Green ©1996-2004 Canadian Mind Products

Java definitions: 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

You are here : home : Java Glossary : J words : JSP.

JSP
Java Server Pages is a language similar to Microsoft's ASP for creating dynamic web pages. Sun has created a language specification. With JSP, a single source textfile is created containing both HTML (or XML) tags and Java-like scriptlets. The JSP-aware web server creates, compiles and runs a servlet from the source text. For increased efficiency, the JSP-aware server will typically cache the compiled servlets. The compiled form are perfectly ordinary Servlets, and thus can be mixed in with ordinary Servlets.

Part of the magic of JSP is that you can replace JSP source code on the fly while the server is active. The next time a request comes for that JSP code, will be automatically recompiled.

To master JSP you need to master several languages:

Hello.jsp

Here is a the JSP equivalent of the HelloWorld program.
view

See servlet for instructions on how to install and run it.

Note how it looks like ordinary HTML with dynamically generated variable content Java code enclosed in <%= ... %>.

Learning More

book_coverCore Web Programming, Second Edition
0-13-089793-0
Marty Hall and Gary Cornell
1250 pages. This is a great doorstop of a book. It has a few chapters on client-server programming in Java, and a section of that is on CGI. I have looked at hundreds of Java books and found nothing that deals in depth with client side Java talking to CGI, except Marty's book. It is really very simple and he does an excellent job of explaining it. Marty has posted all the source code examples from the book for anyone to use. These contain updates and errata fixes you don't get on the CD-ROM that comes with the book.
amazon.com Barnes and Noble
amazon.ca chapters
amazon.co.uk amazon.de
book_coverCore Servlets and Java Server Pages
0-13-089340-4
Marty Hall
Complete text of the book available on line in pdf format.
amazon.com Barnes and Noble
amazon.ca chapters
amazon.co.uk amazon.de
book_coverCore Servlets and Java Server Pages
0-13-067614-4
Marty Hall
Complete text of the book available on line in pdf format.
amazon.com Barnes and Noble
amazon.ca chapters
amazon.co.uk amazon.de
book_coverWeb Development with JavaServer Pages
1-930110-12-X
Duane K. Fields, Mark A. Kolb, Shawn Bayern
A very thorough treatment.
amazon.com Barnes and Noble
amazon.ca chapters
amazon.co.uk amazon.de
book_coverJava Servlet Programming
0-596-00040-5
Jason Hunter, William Crawford
highly reccommended. Covers basics of JSP too.
amazon.com Barnes and Noble
amazon.ca chapters
amazon.co.uk amazon.de
book_coverJava 2 Enterprise Edition BibleJava 2 Enterprise Edition Bible
0-7645-0882-2
Justin Couch and Daniel H. Steinberg
amazon.com Barnes and Noble
amazon.ca chapters
amazon.co.uk amazon.de

Alternatives To JSP

There are two basic alternatives to JSP:
  1. Ones that also rely 100% on server side computing, such as Velocity, Tea and Freemarker. There are scores of lemmings all going for the fundamentally flawed, but easy to implement, 100% server side solution. You can see a list of them under servlet wombs.
  2. Ones that use a combination of server side and client side computing such as Canoo. Flash is about the only mainstream alternative, (unfortunately non-Java), for the combined solution. I have written up a JSP Replacer student project for an all-Java server-controlled client-side validation environmnet.

I am not the only one who thinks JSP is not the greatest thing since sliced bread. Check out these essays:


CMP logo
CMP_home
home
Canadian Mind Products CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[24.87.56.253]
Your IP:[80.134.30.163]
You are visitor number 1863.
Please send errors, omissions and suggestions
to improve this page to Roedy Green.
You can get a fresh copy of this page from: or possibly from your local J: drive mirror:
http://mindprod.com/jgloss/jsp.html J:\mindprod\jgloss\jsp.html