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 ...

Get J2EE™ and JAX™: Developing Web Applications and Web Services 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.