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 forward in a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "forward in a servlet" Watch "forward in a servlet" New topic
Author

forward in a servlet

Javed Mohammed
Greenhorn

Joined: Sep 29, 2005
Posts: 17
Hi,

I just started a web app with login jsp and a servlet. When the login is successful, user should get a welcome message,
other wise login page should be displayed with error message. This is working fine except for one small glitch.

my login URl is
loclahost:8080/webApp/Login.jsp

when the servlet is forwarding, the url in the address bar is displayed as
http://it-laptop2:8080/webApp/servlet/controlerservlet

insted of
loclahost:8080/webApp/Login.jsp

Is this normal or am I doing something wrong?

I am using Tomcat 6 server and my servlet code looks like this.....

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60055
    
  65

As this is not Tomcat-specific, it has been moved to the Servlets forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

A forward doesn't change the URL in the address window at all.
Can you post the page containing the login form?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1506
As already mantioned, forwarding occurs on the backend and the user is not aware that it happened since teh URL remains the same. i.e in this case controllerServlet.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Javed Mohammed
Greenhorn

Joined: Sep 29, 2005
Posts: 17
okay, I thnk I got it.

Sicne the foward does not change the URL, it is stying the same on the browse. I guess I was concerned for no reason. As mentioned earlier, the app is working fine

Thank ya'all for the help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: forward in a servlet
 
Similar Threads
Java Servlets
HTML username password sending to servlet
Servlets example
Using Filters with Struts
HTTP method POST is not supported by this url