Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

response.sendRedirect not working

 
Suleman zia
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All. I have a servlet by the name of CookieLoginServlet. if the login is successful then another servlet "ContentServlet" will display a Wellcome page. For some reason the webpage stays at the same place and does not forward the request to contentservlet.

Meaning if i enter a correct username and password which exist in mydatabase then a wellcome page will display if not then it will send the login form again stating that the password is invalid. Any clues?

CookieLoginServlet



and here is my contentservlet class


Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to supply sendRedirect with a valid URL, not just the name of a Servlet.
 
Suleman zia
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the reply. however i tried your suggestion



my mapping seems to be ok also. however i can't post my mapping the forum gives me an error.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the servlet declaration and its mapping look like?
 
Suleman zia
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are too many "<" so i can't replace it with < all the time. is there any other way to display my xml file? i have posted my xml file before also i mean for other post. looks like javaranch have changed recently.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can post XML by replacing ">" by "&gt;" and "<" by "&lt;".
 
Minh Tran
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Thread hi-jack removed. Minh please start your own topics for your questions.]
[ June 16, 2007: Message edited by: Bear Bibeault ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic