• 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

response.sendRedirect not working

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
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
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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can post XML by replacing ">" by "&gt;" and "<" by "&lt;".
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
reply
    Bookmark Topic Watch Topic
  • New Topic