O'Reilly logo

Struts Kick Start by Kevin Bedell, James Turner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

User Validation and Struts

There are several ways to perform user validation and access control using Struts. One way is through the servlet container itself. Recent implementations of JSP servers (Tomcat 4.0.1, for example) offer an authentication technology called Realms. Realms enables you to specify servlets that should be restricted, and attach to a variety of datasources (JDBC, XML, and so on) to look up access information.

Realms, however, is a bit complicated to set up, especially in a sample application like this. Frankly, there’s really nothing wrong with the time-tested way of doing things, which is to store a flag on the session that indicates that the user has logged in, and control access based on that flag.

In fact, Struts makes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required