tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <Chuck.Caldar...@unisys.com>
Subject RE: [OT] "if" don't work?!?!?
Date Tue, 22 May 2007 14:44:48 GMT
> From: Massimiliano PASQUALONI 
> [mailto:massimiliano.pasqualoni@data-processing.it] 
> Subject: "if" don't work?!?!?
> 
>    if (Pippo == "on") {

Guaranteed to be false.

>     Pippo =  request.getParameter("abilitato");
>     Pluto =  request.getParameter("abilitato");
>  
> the if (Pippo == Pluto )  don't work!

Also guaranteed to be false.

You need to learn Java before embarking on writing webapps for any
container.  The test you're making is one for object equality, not
content equality.  Your expression should be something like:

    if (Pippo.equals("on"))

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message