The equals() method is used to determine if two separate objects are of the
same type and contain the same data. If your objects are null and you
perform an equals operation on a null object then a NullPointerException
will be thrown.
For code maintainability and reusability, I recommend using the struts logic
tags on request parameters:
http://jakarta.apache.org/struts/struts-logic.html#equal
Justy
----- Original Message -----
From: "sufi malak" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 12, 2001 7:53 AM
Subject: if empy & null question again ?
> Hi, I asked the same question last week, please what's wrong with this if
> statment :
> <%
> String ipaddress = request.getParameter("ipaddress");
> System.out.println("ipaddress ??????????" + ipaddress);
> String user = request.getParameter("user");
> String newname = request.getParameter("newname");
> String jack = request.getParameter("jack");
> String os = request.getParameter("os");
> String pc = request.getParameter("pc");
> String processor = request.getParameter("processor");
> String memory = request.getParameter("memory");
> String domain = request.getParameter("domain");
> %>
>
> <% if (
> !ipaddress.equals("")&& !user.equals("")&& !newname.equals("")&&
> !jack.equals("")&&
> !os.equals("") && !pc.equals("") && !processor.equals("") &&
> !memory.equals("") && !domain.equals("")
> ) {
> %>
>
> Thanks
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
===========================================================================
> 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
>
===========================================================================
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