aspose file tools
The moose likes Beginning Java and the fly likes Test User Input Sting to Object Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply 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: 1254
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: 16483
    
    2

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



Here is the LogOnConnetion class that calls the PasswordClass:

 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Test User Input Sting to Object
 
Similar Threads
Jsp Login Page Problem
Help with Remote Data
Connecting to Remote Data
Dynamic JSP
problem validating user login using jsp