GeeCON Prague 2014*
The moose likes Servlets and the fly likes response.sendRedirect  no executing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "response.sendRedirect  no executing" Watch "response.sendRedirect  no executing" New topic
Author

response.sendRedirect no executing

tushar panda
Ranch Hand

Joined: Feb 16, 2009
Posts: 133
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 .


Do Right , Fear No Man
shivendra tripathi
Ranch Hand

Joined: Aug 26, 2008
Posts: 263
With the info provided I can think of only one suggestion
change searchengine=="Google" to searchengine.equals("Google")


SCJP 1.5(97%) My Blog
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
Also, where do searchtext and searchengine come from ?


JDBCSupport - An easy to use, light-weight JDBC framework -
tushar panda
Ranch Hand

Joined: Feb 16, 2009
Posts: 133
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

Joined: Feb 23, 2009
Posts: 1183
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

Joined: Feb 16, 2009
Posts: 133
yeah got it .. working

thanks all ..
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Close the HTML tag properly.
 
GeeCON Prague 2014
 
subject: response.sendRedirect no executing