Intead of using 1 and 0, can you use 'true' and 'false'? . In the package
java.lang there is a class named Boolean which has two constructors. One of
them uses a String as argument and creates a Boolean with true value if the
given string  is 'true' (ignoring case). If the string is null or has any
other value it creates a false boolean variable.

See the java.lang.Boolean reference for more details on
http://java.sun.com/j2se/1.4/docs/api/java/lang/Boolean.html

Regards 

Fran


> -----Mensaje original-----
> De:   Carlos [SMTP:[EMAIL PROTECTED]]
> Enviado el:   mi�rcoles 22 de mayo de 2002 9:39
> Para: [EMAIL PROTECTED]
> Asunto:       convert a String to Boolean
> 
> i have in a jsp page this:
> String state = request.getParameter("state");
> state can be 1 or 0.
> how can i convert this value to Boolean?
> thanks
> 
> ==========================================================================
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
> 
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com

==========================================================================To 
unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to