This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Test User Input Sting to Object" Watch "Test User Input Sting to Object" New topic
Author

Test User Input Sting to Object

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1393
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
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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: 1393
Here is my PasswordClass:



Here is the LogOnConnetion class that calls the PasswordClass:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Test User Input Sting to Object
 
Similar Threads
Dynamic JSP
Help with Remote Data
problem validating user login using jsp
Jsp Login Page Problem
Connecting to Remote Data