>From the documentation of java.lang.String:

strAction.compareTo(String anotherString)
strAction.compareToIgnoreCase(String str)
strAction.equals(Object ob)

strAction == "write" compares the references of the two objects, which is
most likly, if not always to be evaluated to false.


Seems to me that you need some more basic Java knownledge.
Visit comp.lang.java for questions of this kind or check some tutorial.


        /Marcus


-----Original Message-----
From: J�n Dal Kristbj�rnsson [mailto:[EMAIL PROTECTED]]
Sent: den 29 november 1999 12:54
To: [EMAIL PROTECTED]
Subject: request.getParameter() in an if statement


Hi,

can anyone tell me why I can't use any comparison with a requested parameter
value, like this:

        String strAction  = request.getParameter("fmAction");

        if (strAction == "write") {
                out.println("Test");
        }

If I print the strAction string it gives me "write", but the if statement
won't accept it.

Thanks,
Jon Dal

--------------------------------------------
J�n Dal Kristbj�rnsson
[EMAIL PROTECTED]

Innn ehf.
Laugavegur 26
511-3444
--------------------------------------------

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to