Massimiliano PASQUALONI a écrit :
> public boolean StringToBoolean(String StrBool)
>        {
>               boolean convertito=false;
>
>               if ((StrBool == "1") || (StrBool == "On") || (StrBool ==
> "on") || (StrBool == "Yes") || (StrBool == "yes") || (StrBool == "Si") ||
> (StrBool == "si") || (StrBool == "True") || (StrBool == "true"))
>                       {
>                               convertito = true;
>                       }
>
>               if ((StrBool == "0") || (StrBool == "Off") || (StrBool ==
> "off") || (StrBool == "No") || (StrBool == "no") || (StrBool == "False")
> || (StrBool == "false"))
>                       {
>                               convertito = false;
>                       }
>
>               return convertito;
>        }
>   
OMG :)
> If I try 
>
>       if ("on".equals(request.getParameter("abilitato"))){
>                               Abilitato = true;
>                       }
>
>
>   
Works if parameter abilitato is 'on' (not 'On' or 'checked' or whatever
other browser is using)
> Or 
>
>        if (request.getParameter("abilitato").equals("on")){
>                               Abilitato = true;
>                       }
>   
same as above. Also if checkbox is not checked, most browser don't send
parameter an you will end up with a NullPointerException. Check
parameter is not null before calling equals()
> Or
>
>       if (request.getParameter("abilitato") == "on"){
>                               Abilitato = true;
>                       }
>   
Omg² :)
>       Referer = request.getHeader("Referer") 
>       AltroReferer = request.getHeader("Referer") 
>
>       if (Referer == AltroReferer ){...}
>
>   
As already said, not garanteed to work


I recommend you read this:
http://jamesthornton.com/eckel/TIJ-3rd-edition4.0/TIJ303.htm

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

Reply via email to