Karl,

Given that packages effectively provide a namespace, two packages can have
classes of the same name. If you want to
use them both, you need to specify them fully in both the import and useBean
statements.
Having said that, however, why would you want to use them both? One class is
likely to be a specialisation of the other.
But it may be a reason.
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Karl Roberts
Sent: Wednesday, November 24, 1999 10:09 AM
To: [EMAIL PROTECTED]
Subject: Re: Probelm solved but <%@ page import=..%> query


Siva Surya Kumar V wrote:

> Hello sir..
>
>     I just mailed one mail regarding the Vector .
>     I done some R&D and i modified the declaration as:
>     <%! java.util.Vector nam; %>
>
>     And its working !!!!!!!
>
>    Why i have to give this. Infact i imported java.util in JSP file :
>
>     <%@ page import ="java.util.*" %>
>
>     Please tell me. But i got a temporary solution !!!

>
> > <%@ page import = "project.display" %>
> > <%@ page language="java" %>
> > <%@ page import ="java.util.*" %>
>
> > <jsp:useBean id="display" class="project.display" scope="session"/>
> > <jsp:setProperty name="display" property="*"/>
>
> > <HTML>
> > <BODY>
> > <%! Vector name; %>
> > <%= display.getNames() %>
> > </BODY>
> > </HTML>
>
> > But its giving this error !!
> > Class C_0003a.jws.jwsdk.examples.jsp.surya.Vector not found;
> > Vector name;(error at ; ).
>
> > Then i modified the program like
> > Vector name= new Vector(); --> It scolded (:-(.) like any thing.

mmm? don't know why you are getting those errors. I have tried using <%!
Vector name = new Vector() %> and I had no trouble with it. However I think
a similar thing has cropped up before, for instance why when you import a
bean
    <%@ page import="com.myCo.beans.ThisBean" %>
do you then have to give the full package name in the <jsp:useBean > tag?
come to think of it if you give the full package name of a bean in the
<jsp:useBean > tag why do you have to import it in the first place?

Can anyone enlighten me?

Karl

===========================================================================
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

===========================================================================
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

Reply via email to