We spent quite a few posts discussing Java Servlet technology, but now it is time to move onto another part of the Java EE stack - Java Server Pages. At this point there are number of paths we can start down, but since JSP’s both build upon and work closely with Servlets, it seems like a logical next step.
The Basics
- First released in 1999, making the technology almost as old as Servlets.
JSP allows you to write HTML pages which contain embedded Java code. When you request the page, the server will run the embedded code, which usually renders more markup and other data. The final result is (or should be) a valid HTML page, which your web browser will then render.
Essentially, JSP pages are the Java equivalent to PHP, or the ERB templates that are used in Ruby on Rails.