• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is your url-papping entry for the "LoginServlet.java" in your web.xml file ?
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic