JavaServer Pages (JSP)

Study for Week 3

Servlets is a "presentation layer" techology. It helps you present information for the user.

JavaServer Pages (JSP) is another presentation layer technology. The advantage of JSP is that it is much easier to use than Servlets. If your site contains lots of complex HTML, then JSP is a lot faster than trying to get a Java Servlets to produce HTML.

At the end of this session, you should be able to:

  • Understand the purpose of JSP
  • Write a JSP
  • Explain the motivation and challenge of separating domain logic from the presentation
  • Explain and use different patterns for separating the domain logic and presentation

JavaServer Pages

An introduction to JavaServer Pages:

JSP Model 1 and Model 2 architectures

How can we improve the architecture of JavaServer Pages applications?

Layering

A first look at layering in applications.

JSP allows you to separate the HTML from the Java code. But what about the Java code? Can we improve the structure of the Java code. Can that code be broken up again into additional layers?

In other words, can we improve the separation of the Java code that handles the presentation logic from the rest of the Java code that handles the domain/business logic?

If you'd like to study more, then here are some useful links:

If you would like to study in advance of the lecture, you may like to look at these sites:

A simple tutorial: http://www.jsptut.com/

The JSP "Introduction & Overview" section on this page: http://courses.coreservlets.com/Course-Materials/csajsp2.html