You shouldn't need an empty constructor in order to import a class.

I notice the path to your "bean" was :

webapps/mydir/WEB-INF/mybean/mybean.class

classes should go into  WEB-INF/classes  - not the root of WEB-INF !  so u
want :

webapps/mydir/WEB-INF/classes/mybean/mybean.class

That should work

Mehdi




                                                                                       
                                                
                      Ron Smits                                                        
                                                
                      <[EMAIL PROTECTED]        To:       Tomcat Users List 
<[EMAIL PROTECTED]>                            
                      m>                       cc:                                     
                                                
                                               Subject:  Re: package declaration / 
import - new improved!                              
                      28/11/2002 09:50                                                 
                                                
                      Please respond to                                                
                                                
                      "Tomcat Users                                                    
                                                
                      List"                                                            
                                                
                                                                                       
                                                
                                                                                       
                                                




Your bean needs a constructor without arguments like:
public class Abean {
  public Abean () {
   // does nothing
  }
}

this way the bean can be instanciated.

Ron

On Thu, 2002-11-28 at 10:37, [EMAIL PROTECTED] wrote:
> Hi,
>         Similar to a recent posting, after some research into the
subject,
> regarding importing a package into my JSP, I understand thus:
>
> If I have Abean.java and of course Abean.class belonging to package
mybean
> (source below),  in webapps/mydir/WEB-INF/mybean/mybean.class, and my JSP

> in webapps/mydir/index.jsp that includes the bean:
>
> <%@ page language="java" %>
>
> <%@ page import="mybean.*" %>
>
> <html>
> <head><title></title></head>
> <body>TEST</body>
> </html>
>
> I get the error         package mybean does not exist
>                 import mybean.*;
>
> The bean source (only for the technically minded now):
>
> package mybean;
>
> public class Abean {
>
>         public int aMethod() {
>                 int i = 10;
>                 return i;
>                 }
>         }
>
> What am I doing wrong here please? Please someone help!
>
> thanks
>
> Paul.
>
>
>
>



--
To unsubscribe, e-mail:   <
mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <
mailto:[EMAIL PROTECTED]>






--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to