myaction="del" 写错了
        ~~而且
不能用==来比较
用equals方法

解决方案 »

  1.   

    为什么这样不行:  myaction=="del"
    而这样可以: myaction.equals("del")
      

  2.   

    if(myaction.equals("go")){
      ...
    }
      

  3.   

    记住了Java的字符串不能用“= =”来比较要用equals()
    ******引自 Java api文档********
    equals
    public boolean equals(Object anObject)
    Compares this string to the specified object. The result is true if and only if the argument is not null and is a String object that represents the same sequence of characters as this object.
    Overrides:
    equals in class Object
    Parameters:
    anObject - the object to compare this String against.
    Returns:
    true if the String are equal; false otherwise.
    See Also: 
    compareTo(java.lang.String), equalsIgnoreCase(java.lang.String)
    *********************
      

  4.   

    Object之间用“==”其实比较的是2个Object的地址而不是它们的value(值)
      

  5.   

    这个是我在csdn上看到的帖子,具体的url不知道了,我自己留了备份,你看看
    http://www.charry.org/article/list.asp?id=53