• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

forward in a servlet

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.....

 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As this is not Tomcat-specific, it has been moved to the Servlets forum.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic