Java EE Tutorial covering JSP 2.2, and Servlets 3.0

From Resin 4.0 Wiki

Jump to: navigation, search


  • 1 Java EE, CDI, Servlet 3.0 and JSP 2.2 tutorial
  • 2 Tutorial style
  • 3 Cookbooks and Tutorials
  • 4 Resources
  • 5 Feedback
    • 5.1 In scope (In no particular order)
    • 5.2 Out of scope

Java EE, CDI, Servlet 3.0 and JSP 2.2 tutorial

This tutorial focuses on using Servlet's and JSP the right way. Servlet and JSP have evolved over the years, and now there is often more than one way to do things. For example, this tutorial uses EL and JSTL not JSP scriptlets, it uses JSPs in a Model 2/MVC style not in a model 1 style, etc. Consider it a tutorial that focuses only on the best practices and not the legacy ways to do things.

There are other tutorials on this subject, but this tutorial is going to be different in that it is going to put all code into github, and you can follow along with Eclipse. Also instead of focusing on JSF, we are going to focus on JSP and Servlets as the main view technology.

Java EE, JSP and Servlets have added a lot of features that are in other frameworks, making those other frameworks less relevant then they were before Java EE garnered these extra abilities. Even is you decide to use JSF, Struts, Stripes, Spring MVC, JSF, etc., this tutorial should help you have a better understanding of the JSP/Servlets core that they build on.

We are going to start by building a simple bookstore. We will progressively add more features to the bookstore and as we do we will use more of Java EE/CDI, JSP and Servlets.

For this tutorial, I am going to use Resin 4.0.x, but you could use any Java EE 6 Web Profile compliant application server.

Tutorial style

  • Not going to list every option of every tag, configuration, etc.
  • Not going to teach you something you are suppose to avoid anyway or that is deprecated
  • Build something real enough to ensure that things actually work and we don't miss something common
  • Don't build something too real so that the concepts are hard to ascertain outside of the domain of the example
  • Provide cook books on how to do common tasks like I18n, etc.
  • IDE, Performance testing, Debugging, etc. from the start!

I can go on and on about each point. I've seen a lot of tutorial and books out there, and they drag you down with detail you don't need. (You can alway google it later). Or, they skip out very important things because their examples are too simple.

Cookbooks and Tutorials

  • Building a simple listing in JSP: covers model 2, Servlets, JSP intro.
  • Java EE Servlet tutorial : Adding create, update and delete to the bookstore listing: covers more interactions.
  • Java EE Servlet tutorial : Using JSPs to create header, footer area, formatting, and basic CSS for bookstore.
  • Java EE Servlet tutorial : Adding MySQL and JDBC to bookstore example.
  • Java EE Servlet/JSP tutorial : Adding an error page, logging, and other forms of debugging.
  • Java EE Servlet tutorial : Adding validation and JSP tag files to bookstore example.
  • Java EE Servlet tutorial : Adding I18N support to bookstore example.
  • Java EE Servlet tutorial : Load testing and health monitoring using bookstore example.
  • Java EE Servlet tutorial : Setting up clustering and session replication.
  • Java EE Servlet tutorial : Setting up security for bookstore example.
  • Java EE Servlet tutorial : File uploads for bookstore example.
  • Java EE Servlet tutorial : Using JPA for bookstore example.
  • Java EE Servlet tutorial : Using JCache for bookstore example.


Each cookbook will eventually have a corresponding slide deck, video and source code on github associated with it.

  • Slides
    • Java EE JSP/Servlets Tutorial
    • Java EE Servlet/JSP Tutorial- Cookbook 1
    • Java EE Servlet/JSP Tutorial Cookbook 2
  • Source code hosted on github
  • Videos
    • Java EE Tutorial covering JSP and Servlets
    • Java EE Servlets/JSP Tutorial - Cookbook 1 - Part 1

There are a few more videos and slide decks in the work.


Feedback welcome. If you see something crazy or less efficient then it needs or a new API I missed, etc., let me know. (rick AT caucho dot com). I don't know everything, and I welcome feedback.

In scope (In no particular order)

  • Eclipse WTP
  • JSP
  • Unified EL
  • Tag files
  • Servlet Filters
  • Servlet 3 extension points
  • JSP EL
  • JDBC
  • JPA
  • File uploads
  • NoSQL
  • CDI
  • Session replication
  • Cloud deployment
  • Internationalization
  • JavaScript
  • Ajax
  • HTML 5
  • Validation (standard, and JavaScript)
  • WebSockets
  • Long polling
  • Load Balancing
  • HTTP Caching
  • Performance tuning
  • maven
  • JCache / Memcached
  • Clustering
  • Load balancing
  • Quercus/PHP for Java (good comparative discussions of JSP and PHP)
  • JMX
  • Rewrite rules
  • Health monitoring / Garbage collection
  • etc.

The idea behind this tutorial is that you can build your Java knowledge and web development foundation. If you are new to Java web development or have been doing it a while, but just don't get the ins and outs, then this tutorial will hopefully help you get to the next level.

Out of scope

  • JSF (maybe later, but not before we really explore the core)
  • Spring
  • Struts
  • Seam
  • NetBeans
  • Any framework above and beyond Java EE 6 that has significant overlap with Java EE 6
Retrieved from ",_and_Servlets_3.0&oldid=590"
  • Page
  • Discussion
  • View source
  • History
Personal tools
  • Log in
  • Main page
  • Community portal
  • Current events
  • Recent changes
  • Random page
  • Help
  • What links here
  • Related changes
  • Special pages
  • Printable version is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.