Hi Olga,
you can not create instance of interface in Java. You have to have
non-abstract class.
But you can use some like that for existing beans:
<jsp:useBean id="yourBean" scope="yourScope" type="yourInterface" />
----------------------------------------------
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
ColdJava: java server side programming
http://coldjava.hypermart.net
____________________________________________________________________
Get your own FREE, personal Netscape WebMail account today at
http://webmail.netscape.com.
===========================================================================
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