Home > Back-end >  God help me
God help me

Time:10-13

Why equals comparison always returns false

@ RequestMapping (value="https://bbs.csdn.net/yanzheng1.do", method=RequestMethod. GET)
Public void yanzheng1 (@ Param (" zdmjText ") String zdmjText, @ Param (" zdmName2 ") String zdmName2, @ Param (" targetName ") String targetName, HttpServletResponse response) throws IOException {
int count=0;
List Lists=this. PlanningsDashboardDao. SelectTargetmanagementNameAndBase ();
//DashboardTargetmanagement s=this. PlanningsDashboardDao. SelectTargetmanagement (targetName);
System. The out. Println (zdmjText. Replace (" ", ", "));
String ss=zdmjText. Replace (" ", ", ");

For (DashboardTargetmanagement I: lists) {
If (i.g etTargetName (.) the equals (ss)==true) {
Count=0;
} else {
count++;
}

}
//for (int I=0; i//if (lists equals (" zdmjText ")==true) {
//count=0;
//} else {
//count++;
//};
//
//}
The response. SetHeader (" the content-type ", "text/HTML. charset=UTF-8");
The response. SetCharacterEncoding (" utf-8 ");
PrintWriter write=response. GetWriter ();
Write. Write (JSONUtils. ToJSon (count));
};

CodePudding user response:

A breakpoint see i.g etTargetName () of value and the value of the ss were what to know

CodePudding user response:

A break point with look at no

CodePudding user response:

The

CodePudding user response:

This can't equal, you targetName is different in the ss and the I

CodePudding user response:

Well, but System. Out. Println (i.g etTargetName ()); This, take the contents of the database through out, I want to take the input value for the text field and database comparison to see whether correct

CodePudding user response:

You contrast the count is zero, so if you use to judge,
  • Related