aspose file tools*
The moose likes Servlets and the fly likes Request parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Request parameter" Watch "Request parameter" New topic
Author

Request parameter

jose chiramal
Ranch Hand

Joined: Feb 12, 2010
Posts: 266
<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

Joined: Dec 08, 2009
Posts: 174

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
Chinna Eranna
Ranch Hand

Joined: Dec 08, 2009
Posts: 174

Can you show, How did the color object is initialized?
Amaan khan
Greenhorn

Joined: Nov 29, 2008
Posts: 14

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.


OCPJP (SCJP) 6.0 93%

--- Fear Thy Lord ---
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Because it's a string? Or some other class whose equals() method takes a string?
jose chiramal
Ranch Hand

Joined: Feb 12, 2010
Posts: 266
Thanks David,Newton for your reply.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Request parameter
 
Similar Threads
Problem with Devakas Final Exam Q on Static Thread methods
question on jsp
Firefox doesn't show background color for selected option
Values of Array Elements are returning Undefined
Defining Highlight color of Selected Index