7.4. Example: BASIC Authentication

In Section 7.2, I showed the external Web site for a fictional company named hot-dot-com.com. In this section, I’ll show their intranet. Since applications that use form-based authentication vary only slightly from those that use BASIC authentication, I’ll just concentrate on the differences here. I’ll start by showing the home page, then list the web.xml file, summarize the various protection mechanisms, show the password file, and give the code for each of the protected resources.

The Home Page

Listing 7.23 shows the top-level home page for the Web application. The application is registered with a URL prefix of /hotdotcom-internal so the home page can be accessed with the URL http://host/hotdotcom-internal/index.jsp ...

Get More Servlets and JavaServer Pages™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.