if(request.getParameter("action")!=null){
String action=request.getParameter("action");
if(action=="img"){
out.print("img");
}else if(action=="wz"){
out.print("wz");
}else{
out.print(action);
out.print(action=="img");
out.print(action=="wz");
}
}else{
out.print("action");
}
这个好奇怪.
不论action等于img或不等于img
action=="img"都得到false..
这是怎么回事?
------解决方案--------------------
if(action.trim().equals("img"))这样