• Post Reply Bookmark Topic Watch Topic
  • New Topic

doPost() not invoked and doGet() receiving null parameter values

 
Hemanth Kumar Simhadri
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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?

any idea about this..

 
chandra kambham
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is your url-papping entry for the "LoginServlet.java" in your web.xml file ?
 
Abhinav Kansal
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!