8.3. Handling User Preferences
For each user, we want to record their favorite team to be used in producing the output of the Favorite Team page. In earlier versions of the application, we didn't save this information and instead required the user to specify it as part of the page request each time they visited. The preferences.jsp page is used to set the team. A favorite team is selected from a list of all valid teams, which means we must prepare such a list before we can display the page. In Listing 8.12, we see the LoadTeamlistAction class that obtains a list of teams and places the list as a bean at application scope. (The same list of teams would be presented to any user who visited, so there is no need to restrict this to page or request ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access