Let's change basic authentication to form-based authentication, so that we can customize the login page. We need to update <login-config> in web.xml. Replace the previous <login-config> block with the following:
<login-config> <auth-method>FORM</auth-method> <realm-name>courseManagementJDBCRealm</realm-name> <form-login-config> <form-login-page>/login.jsp</form-login-page> <form-error-page>/login-error.jsp</form-error-page> </form-login-config></login-config>
We have replaced <auth-method> from BASIC to FORM. For form-based authentication, we need to specify form-login-page, which we have specified as login.jsp. form-error-page is optional, but we have set that to login-error.jsp.