I have an old servlet ABC using a web.xml to define it's form login (which is another servlet XYZ stored in another JAR file and integrated in the WAR under path WEB-INF\lib):
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/login</form-login-page>
<form-error-page>/login?event=Retry</form-error-page>
</form-login-config>
</login-config>
Now I migrated servlet ABC using the new Servlet 3.0 annotations. I have a @WebServlet
and a @ServletSecurity
annotation. But how do I define that my login configuration is a form based login (auth-method
in web.xml) and what URL the webcontainer should redirect the request to (form-login-page
in web.xml)? I found a tutorial with note that when using form-based-login I must use a deployment descriptor.
I didn't find a remark regarding this in the servlet 3.0 spec. Does anybody know if this is correct? Or are there any annotations or other ways to prevent me from using a deployment descriptor?