Securing applications in GlassFish
We will use the Course Management application that we developed in Chapter 7, Creating JEE Applications with EJB, to add security features. Follow these steps to import projects:
- Create a new Eclipse workspace for this chapter.
- Copy all the projects in the source code folder for Chapter 7, Creating JEE Applications with EJB, inside the
with-maven
folder, to the current workspace. - Import all the projects into the new workspace (open the
File
|Import
menu and then selectMaven
|Existing Maven Projects
).
You should now have the following projects in your Eclipse workspace: CourseManagementMavenEAR
, CourseManagementMavenEJBClient
, CourseManagementMavenEJBs
, and CourseManagementMavenWebApp
. Let's now learn how to protect access to JSPs in a folder.
Protecting access to folders in web applications
To protect any resources in a web folder, you need to declare security constraints in web.xml
. In the security constraints, you can declare URLs that are to be protected...