File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Servlet not dircting to the next page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet not dircting to the next page" Watch "Servlet not dircting to the next page" New topic
Author

Servlet not dircting to the next page

Hend Ahmed
Greenhorn

Joined: Mar 22, 2011
Posts: 12
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

Joined: Jun 27, 2008
Posts: 28
Try


and then


Regards
Hend Ahmed
Greenhorn

Joined: Mar 22, 2011
Posts: 12
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet not dircting to the next page