Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

why res.sendRedirect() not work under doPost() Method?  RSS feed

 
asif kilwani
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing problem in redirecting my user to the next page after they made a successful login. I have openend my connection in init() and in doPost() i am running my select command to check the username & pw in database & if they made a successful login, they redirect to my next servlet.
Plz help

------------------
regards,
Asif Kilwani
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the exact nature of your error?

What is the error message?
 
Mike Nightsky
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make just one Servlet, and check if the user is logged in.
if he is not send back the form.
if he is logged in send back the actual page.
Thats the way i do it in my project.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!