• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Request parameter

 
jose chiramal
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<html>
<body>
<form method ="POST" action="SelectBeer.do">
<select name="color">
<option>red
<option> blue
</select>

in the code when we say
if (color.equals("red"))
{
System.out.println("welcome color is red");
}

Here how is color an object ??
 
Chinna Eranna
Ranch Hand
Posts: 174
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jose chiramal wrote:
in the code when we say
if (color.equals("red"))
{
System.out.println("welcome color is red");
}

Here how is color an object ??


Which code you are taking about ? Servlet or Some Action class in java ?

 
Chinna Eranna
Ranch Hand
Posts: 174
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show, How did the color object is initialized?
 
Amaan khan
Greenhorn
Posts: 14
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Chinna Eranna wrote:
jose chiramal wrote:
in the code when we say
if (color.equals("red"))
{
System.out.println("welcome color is red");
}

Here how is color an object ??


Which code you are taking about ? Servlet or Some Action class in java ?




I guess the question quoted here isnt complete. Try posting complete details of the same.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because it's a string? Or some other class whose equals() method takes a string?
 
jose chiramal
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David,Newton for your reply.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic