wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Test User Input Sting to Object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Test User Input Sting to Object" Watch "Test User Input Sting to Object" New topic

Test User Input Sting to Object

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1394
I can not get the following code to work. It never matches eventhough I know it should:

I unencrypt the password from the remote data then I test it against the user input string.

Paul Clapham

Joined: Oct 14, 2005
Posts: 18541

In this code:I can see that unEncriptedpassWord is a PasswordClass object. But what about arg1? I suspect it is a String. Am I right? If that's the case, it can never be equal to a PasswordClass object. You would have to extract a String from that PasswordClass object and compare that to arg1.
Michael Labuschagne
Ranch Hand

Joined: May 08, 2007
Posts: 56

The code below doesn't explain much about what is happening, you'd have to show the code for "PasswordClass" and there is no reference to what the arg1 object/variable is. If it an object and is not overriding the Object classes equals() method than the all that "if statement" is doing is checking if the unEncriptedpassWord object and the arg1 object are the same object.

Please provide more information reqarding the classes involved.

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1394
Here is my PasswordClass:

Here is the LogOnConnetion class that calls the PasswordClass:

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Test User Input Sting to Object
Similar Threads
Connecting to Remote Data
Jsp Login Page Problem
Dynamic JSP
Help with Remote Data
problem validating user login using jsp