In our project we are implementing the LDAP authentication for our web application. We are using the j_security_check for the authentication through LDAP. we are able to login, but the servlet which we are using for this is getting the Parameter(username & password) values as null.
to configure the LDAP, we extended the out of the box servlet and we overridden the doGet() method of it.
our classe is like..
The OriginalLoginServlet is like this..
One problem is that we dont have the source code of the OriginalLoginServlet which is the out of the box.
in our LoginServlet, we see that the doPost method is not getting invoked at all, and only the doGet is getting called even if we used the POST method in the login form.
The login form is like this:
We are not able to get the values form the j_username and j_password. We are getting them as null. Is this due to the inheriting the OriginalLoginServlet?
Why only the doGet() method in the LoginServlet is called?
One reason for doPost of LoginServlet.java is not getting called is that Original Servet is calling doGet in doPost. So even if your method is POST in HTML, you will still receive a call in doGet. I assume the form action URL is mapped to the originalFramework and not to the LoginServlet in you web.xml.
Reason for getting null param values can only be explained depending on how you have mapped your servlets.
One thing which you can try is calling super.doGet and super.doPost in Loginservlet.
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop