What info can you get from an HttpServletRequest?

Steve Neal Development, Java Programming Leave a Comment

There are many methods on an HttpServletRequest, and if you’re anything like me, you’ll forget exactly what each of them returns. Rather than a long winded investigation into them all, here’s a sample URL: https://localhost:8443/test/welcome?a=1&b=2 The ‘/test’ in the URL will map to a servlet called test. The servlet will dispatch the request to a JSP for rendering that has …

Implementing Flash Scope in Java Web Applications

Steve Neal Development, Java Programming 6 Comments

While working recently on a Spring MVC project I found myself wishing it supported flash scope. I hunted around for a simple solution but couldn’t find anything that didn’t rely on having to import large framework libraries. After a little thought I came up with the following simple and lightweight solution that has worked really well for me. I’ve included …

How to Access the Size of a Collection in a JSP Page Using JSTL-EL

Steve Neal Development, Java Programming 13 Comments

A common and frustrating problem that many programmers encounter when first working with JSPs is how to access the size of a Collection using the JavaServer Pages Standard Tag Library (JSTL) and the Expression Language (EL). This article discusses this problem and illustrates a best practice solution. The Problem The JSTL and EL greatly reduce the amount of Java code …