Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet not dircting to the next page

 
Hend Ahmed
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to publish the web application i have. However i have this problem that at first when the user tries to log in, the login.jsp will take to the loginServlet which will if the login successfuly will take to homepage.jsp. I believe the username and password are being passed to the servlet since in the URL i get something like: ... /LoginServlet?user=hh&pass=hh

However it gives me error : The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. HTTP Error 404 - File or directory not found.

i dont know where is the problem Please advise.. it will be appreciated.

The code of the servlet is below ..

 
Lino Larios
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try


and then


Regards
 
Hend Ahmed
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lino,
Thanks for your reply..
i tried what you have suggested.. but it gave me error: the method getServletContext() is not defined for the ServletContext
so i had to change the method. to this



I have tried the above code but it still gives me the same error that the The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
--------------------------------------------------------------------------------
Please advise

I have also one question, this error does it mean that the servlet does not forward to the jsp (HomePage) in a way that HomePage is not available.. OR it also mean that the username and password wasn't checked from the first place? actually i dont know if it accessed the database or not..


Thanks in advance

Hend
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic