Peter,

In Java,
("TEXT").equals(null) does not throw a runtime Exception
but (null).equals("TEXT") will throw a  NullPointerException.

In your case, getAreaType() method might be returning a null.

TRY

 <%= (inputparams.getAreatype()).equals("Nativeforest")?"Checked" :
"Notchecked" %>

This should work fine.

Hope this works.


Kishore Raghavan
Synapta Inc.


-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Peter Hutchinson
Sent: Tuesday, May 02, 2000 7:18 PM
To: [EMAIL PROTECTED]
Subject: "Equals" method not working correctly?


Hi,
        I have the following problem :

The expression :

 <%= inputparams.getAreatype().equals("Nativeforest")?"Checked" :
"Notchecked" %>

compiles OK but crashes the JSP

BUT

<%= "Nativeforest".equals(inputparams.getAreatype())?"Checked" :
"Notchecked" %>

works OK !

Any suggestions?

Peter

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
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".
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