[thelist] JSP fumbling.....

Paul Roub paul at roub.net
Sat Nov 16 21:42:01 CST 2002


The == operator checks for object identity in this case, not identical
values.  You wan to say:

	if (HTTPMethod.equals("POST"))

-paul


-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Anthony Baratta
Sent: Saturday, November 16, 2002 9:39 PM
To: thelist at lists.evolt.org
Subject: [thelist] JSP fumbling.....


Why does this *always* evaluate to false??

   String HTTPMethod = request.getMethod();
   if (HTTPMethod == "POST") {
      System.out.println("True");
   } else {
      System.out.println("False");
   }

Yet

      System.out.println(HTTPMethod);

On a form submit prints POST.

I'm stumped.
---
Anthony Baratta
President
Keyboard Jockeys

"Conformity is the refuge of the unimaginative."

--
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !




More information about the thelist mailing list