Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

forward in a servlet

 
Javed Mohammed
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As this is not Tomcat-specific, it has been moved to the Servlets forum.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A forward doesn't change the URL in the address window at all.
Can you post the page containing the login form?
 
Bosun Bello
Ranch Hand
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Javed Mohammed
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic