I'm trying to run this simple code which checks if a password exists in an xml user file.
But everytime I run this nothing prints out on the web page! I have no problem using the .getTextContent to print out a list of all users passwords, but this comparison statement never evaluates to true for some reason, using .equals() even gives me a nullpointer exception!
Code:
for (int y = 0; y < passwords.getLength(); y++) {
if (password == passwords.item(y).getTextContent()) {
out.println("yes");
}
}
But everytime I run this nothing prints out on the web page! I have no problem using the .getTextContent to print out a list of all users passwords, but this comparison statement never evaluates to true for some reason, using .equals() even gives me a nullpointer exception!
Last edited: