• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

response.sendRedirect no executing

 
tushar panda
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my servlet code :


in line 28 & 29 i get the values of searchtext and searchengine which i have entered during testing but why doesn't those values are used in line 25 to redirect .
 
shivendra tripathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With the info provided I can think of only one suggestion
change searchengine=="Google" to searchengine.equals("Google")
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, where do searchtext and searchengine come from ?
 
tushar panda
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sebastian Janisch wrote:Also, where do searchtext and searchengine come from ?


they are form data passed from html file and i have checked that , they are passed and display results .

as i have told earlier in line 28 and 29 i get values , but i don't get a redirect with the same values in line 25.
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is most certainly this: searchengine=="Google"

You can't check a String for equality using the == operator. You need to use searchengine.equals(), as shivendra tripathi already stated.
 
tushar panda
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah got it .. working

thanks all ..
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Close the HTML tag properly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic