Overview of JavaServer Pages (JSP)

JavaServer Pages (JSP) are Sun’s answer to Active Server Pages. The JSP syntax is similar to that of ASP and in general, the two offer similar capabilities. One of the advantages of JSP, of course, is that you aren’t limited to using Microsoft’s Web server. You can use JSP with different Web servers on operating systems, including both Unix and Windows. All you need to run JSP is a Java runtime environment.

Like ASP, JSP uses <% and %> to enclose executable code. It also uses <%= and %> to enclose expressions. Listing 10.1 shows a simple JSP page that uses both types of tags.

Listing 10.1. Source Code for simple.jsp
 <% String greeting = “Hello There!”; String date = (new java.util.Date()).toString(); double ...

Get Special Edition Using XSLT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.