Chapter 1. JSP Overview: The Components of a JavaServer Page

JavaServer Pages, also known as JSPs, are a simple but powerful technology used to generate dynamic HTML on the server side. They are a direct extension of Java servlets and provide a way to separate content generation from content presentation. The JSP engine is just another servlet that is mapped to the extension *.jsp. The following code contains a simple example of a JSP file:

<HTML>
<BODY>

<% out.println("HELLO JSP WORLD"); %>

</BODY>
</HTML>

Its output would look similar to Figure 1.1.

You can see that this document looks like any other HTML document with some added tags containing Java code. The source code is stored in a file called HelloJSPWorld.jsp and copied to the document ...

Get Pure Java Server Pages™ 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.