Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Request Parameters

 
Frank Daly
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
does anyone have a problem working with request parameters. My servlet has an If construction based around the value of a request parameter. I see the value of this parameter in the URL and I display it on the page but when i compare it to this value, i don't get a match. Is there a simple solution to this?
thanks
frank
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using '==' for the comparison? Make sure you are using "equals()", or "equalsIgnoreCase()". If this is not the problem, can you put a small code-snippet of where you read and use the parameters here.
 
Frank Daly
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Frank
That solved my problem. I just reread page 100 of Just Java 1.2; it says "Failing to use 'equals()' to compare two strings is probably the most common single mistake made by Java novices." this java novice won't make this mistake again
frank
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AMEN!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic