• Post Reply Bookmark Topic Watch Topic
  • New Topic

response.sendRedirect no executing  RSS feed

 
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 .
 
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")
 
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 ..
 
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Close the HTML tag properly.
 
The glass is neither half full or half empty. It is too big. But this tiny ad is just right:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!