• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SessionServlet and Login.jsp

 
Kevin Weiss
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm trying to setup a simple session login JSP page servlet. Basically, I have the following files:
1) login.jsp
2) index.jsp
3) SessionLogin (Servlet)

What should happen is after success fully logging in (login.jsp uses SessionLogin Servlet) goes to the website index (index.jsp).

Everything compiles and runs fine, except the both doGet *and* doPost go to index.jsp...regardless if the username or password is right or wrong. I'm unsure what I doing wrong here.

Here are the file contents:

login.jsp



index.jsp


SessionLogin.java


Any help to get me in the right direction is much appreciated. Thanks in advance!

PS - I don't know if it matters, but I'm using netbeans 5.0, tomcat 5, postgresql 8.1
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64623
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basic debugging techniques: have you determined which branches through the code tree that your request is taking?
 
shrikant patelin
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As seen in the login.jsp, u are not specifying whether Get or Post method should be used. So by default it is going to use Get method. The if u analyse the Get method u are always directing it to index.jsp. I doubt if Post method is getting called.
 
Kevin Weiss
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks everyone. I guess I just needed a break and some (obvious) advice. I changed the following lines of code:



Now it works as expected.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic