Ok, this is stupid, but wtf is going on?
I have a String variable in a servlet, which takes the value of a parameter and based on that value I make a test to do something, but the if
is not working. What is the problem?
String action = request.getParameter("action");
System.out.println("Action: " + action);
// I put 2 ifs to be sure, but not even one is working
if(action.equals("something"))
{
System.out.println("hey");
}
if(action.trim() == "something")
{
System.out.println("hey");
}
On the console, the System.out.println shows me that the value of action is "something"
Action: something