What This Book Actually Is

It is a slim reference guide covering JSP 1.1 and the Servlet API as they existed around 2001. Not a tutorial, not a full textbook. Think of it as something you keep open on your desk when you are reading legacy code or working inside an older Tomcat environment. The O'Reilly style, compact format, quick lookup index. Useful in its context, limited outside of it. I picked this up around 2004 when I inherited a Tomcat 3.2 app with JSP 1.1 pages, custom tag libraries, and scattered includes. My main use case was not learning JSP from scratch. It was figuring out why a particular <jsp:useBean> scope chain was resolving to a stale session attribute instead of creating a new instance. The book had the exact syntax table for bean scopes, the attribute inheritance rules, and the request-dispatcher behavior in one place. Saved me from digging through fragmented mailing list archives. The book covers the standard JSP directives, action elements, scriptlet patterns, expression language before EL became standardized, the custom tag model, JSTL 1.0 as an optional add-on, and Servlet integration. Bergsten also goes into connection pooling patterns with DataSource, session tracking workarounds, and the translation phase from JSP to servlet source. Those last sections are where the practical value sits. Not the syntax tables everyone already has online.

Where to Get It

The original paperback is out of print. You will find used copies on Amazon Marketplace, AbeBooks, eBay, and occasionally on specialized tech book resellers. Prices range from about $5 to $25 depending on condition. A few copies surface on Google Books for preview, but those are incomplete. For a physical copy that holds up, check the O'Reilly used book inventory or the Internet Archive for borrowing access. There is no official digital edition released by the publisher. The content exists in various PDF dumps floating around the web, but those are unofficial and quality varies. If you can tolerate paper, a used copy in good condition is the most reliable path. The paperback itself is thin enough to fit in a bag without being a burden.

What It Handles Well

The reference tables are the strongest part. Action element attributes, directive order rules, page-context method signatures, the life-cycle callback methods for SimpleTag versus the older Tag interface. These are the things that change between JSP 1.1 and 1.2, between Tomcat 3 and Tomcat 4, and the kind of detail that is tedious to reconstruct from memory during a production incident. I spent roughly two days once chasing a NullPointerException in a custom tag that used TagSupport.doStartTag() instead of the newer SimpleTag.doTag() approach. The book laid out the method signatures side by side for both models. I identified the mismatch between the tag library descriptor version and the container implementation within an hour. Without that comparison chart, I would have been reading Tomcat source code all day.

Get the Full Details

JavaServer Pages Pocket Reference 1st Edition Hans Bergsten | PDF
JavaServer Pages Pocket Reference 1st Edition Hans Bergsten | PDF

Pitfalls and Limitations

This is a JSP 1.1 reference. The Jakarta EE ecosystem moved on. Expression Language arrived in JSP 2.0. JavaServer Faces was emerging. Spring MVC was taking shape. If you are starting a new project in 2025 or later, this book is historically interesting, not practically actionable. The coverage of JSTL is limited to version 1.0. Most production systems migrating away from scriptlets ended up on JSTL 1.1 or 1.2. Core and functions tag libraries got significant changes. The routing and validation tag in JSTL 1.1 did not exist in the coverage here. You will need a separate JSTL reference if your work involves anything beyond basic iteration and conditional logic. Another gap: the book assumes you are working in a monolithic WAR deployment with direct servlet containers. It does not address container-managed transaction demarcation in application servers like WebLogic or WebSphere, which was common in enterprise environments at the time. If you were porting JSP apps between Tomcat and a commercial app server, the behavioral differences around session persistence, classloading, and implicit object availability are not covered.

Edge Case That Almost Broke a Deployment

I ran into a problem with JSP precompilation using JspC against a WAR that contained tag libraries referencing classes in WEB-INF/lib. The precompiled servlets failed at runtime because the classpath resolution during compilation did not include the nested JAR dependencies the same way the running container did. The book mentions JspC briefly in the deployment chapter but does not walk through this scenario. The workaround I used was to extract the tag library JARs into WEB-INF/lib as separate files, then run JspC with the -classdir and -uri flags pointing to an explicit classpath that included those same JARs. After precompilation, I re-packaged the WAR and verified the generated servlet sources compiled cleanly against the deployed classpath. It added about 40 minutes to the build process but eliminated a class-not-found error that only appeared after a clean redeploy.

Practical Reading Strategy

Do not read it cover to cover. Go to the section you need. The pages are organized by topic, not by narrative flow. Check the directives chapter when you are troubleshooting page-level behavior. Check the custom tag chapter when you are writing or debugging a tag handler. Check the scripting chapter when someone has left embedded Java code in a JSP and you need to understand exactly what the compiler will generate. The index is adequate. The cross-references between action elements and their corresponding Java equivalents are the most useful part. Bergsten maps each JSP action to the underlying PageContext or HttpServletRequest method call. That mapping is what turns this from a syntax list into a debugging tool. If you are maintaining a legacy JSP application from the early 2000s, this book is worth having nearby. If you are building something new, skip it and use current documentation for Servlet 6.0, Jakarta EE 10, and the modern tag library specs. The core concepts are the same. The details have shifted enough that following a 2001 reference on active development work will introduce more confusion than clarity.

‎JavaServer Pages Pocket Reference by Hans Bergsten on Apple Books
‎JavaServer Pages Pocket Reference by Hans Bergsten on Apple Books