Olga,
As far as I know, you can never instantiate an interface (regardless of jsp). You instantiate a class that implements that interface and then you can pass it to classes that accept objects of the interface type..
Well.. at least as far as I know. :)
-----Original Message-----
From: Olga Penina [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 14, 1999 8:00 AM
To: [EMAIL PROTECTED]
Subject: usebeans as java interfaces - how ?
I'd like to be able to use interfaces instead of concrete class
implementations in my jsp.
However, according to the spec, jsp engine needs to be able to instantiate
the bean if it is not found in the scope. As a result the page compiler
fails to compile something like:
if (pageGuard == null) { // begin 'pageGuard' instantiation block...
file://[Line: 2]
try { file://[Line: 2]
pageGuard = (java.security.Guard)
java.beans.Beans.instantiate(getClass().getClassLoader(),
"java.security.Guard"); file://[Line: 2]
Would the future JSP implementations allow the use of interfaces ?
How can I modify the page complier to throw an exception w/o trying to
instantiate a bean?
Thanks,
Olga
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
