This is going to come as a complete surprise:

You can't convert an int to a boolean.

You've never been able to, in Java.

You can't now.

You're not likely to be able to in the future.

The error message doesn't say "You can't eat chop suey on Fridays" when it
means "can't convert int to boolean." If it did, I'd have a little more
compassion.

What does it mean? It means the language is looking for a boolean, and
you're giving it an int.

As well, you're doing an awful lot of assignments instead of the comparisons
I think you mean....


>From: sufi malak <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
>     reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Can't convert int to boolean. ??
>Date: Fri, 16 Feb 2001 17:09:02 -0000
>
>what's wrong with this if statment :
>
>Can't convert int to boolean.
><%
>String  imageurl = (String)request.getParameter("txtImageURL");
>String  lastname = (String)request.getParameter("txtLastName");
>String  firstname = (String)request.getParameter("txtFirstName");
>String  id = (String)request.getParameter("txtId");
>String  phone = (String)request.getParameter("txtPhone");
>String  date = (String)request.getParameter("txtDate");
>String  department = (String)request.getParameter("txtDept");
>String  extension = (String)request.getParameter("txtExt");
>String  email = (String)request.getParameter("txtEmail");
>String  note = (String)request.getParameter("txtNotes");
>String  nominatedby = (String)request.getParameter("txtNominatedby");
>
>%>
><%
>Driver DriverResults =
>(Driver)Class.forName(MM_connCompass_DRIVER).newInstance();
>Connection ConnResults =
>DriverManager.getConnection(MM_connCompass_STRING,MM_connCompass_USERNAME,MM_connCompass_PASSWORD);
>PreparedStatement StatementResults;
>String stmt = "insert into employee VALUES(id, firstname, lastname,
>nominatedby, photo, extension, department, note, phone, email, date)";
>StatementResults = ConnResults.prepareStatement(stmt);
>if (!((imageurl =null) | (lastname =null) | (firstname =null) | (id  =null)
>| (phone  =null) |
>   (department =null) | (date  =null) | (extension =null) | (email =null) |
>(note =null) | ( nominatedby =null) ))
>StatementResults.executeQuery();
>
>%>

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.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://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to