You can also use Boolean.getBoolean(request.getParameter("state")). I think
that way you avoid creating a Boolean instance (correct me if I'm wrong).-----Original Message----- From: Kesav, Ramesh [mailto:[EMAIL PROTECTED]] Sent: May 22, 2002 - Wednesday 2:56a To: [EMAIL PROTECTED] Subject: Re: convert a String to Boolean boolean stateValue = new Boolean ( request.getParameter("state").toString() ).booleanValue() Regards Ramesh Kesavanarayanan [EMAIL PROTECTED] Off: 91-44-8113801 ext 2333 Res:91-44-2265360 Mob : 91-98412-73573 > -----Original Message----- > From: Carlos [SMTP:[EMAIL PROTECTED]] > Sent: Wednesday, May 22, 2002 2:09 PM > To: [EMAIL PROTECTED] > Subject: 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 =========================================================================== 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
