My apologies Amit,
I did some quick testing and as far as I can tell you are correct. I
could not instantiate a bean in a JSP page using <jsp:usebean> or "new"
in a scriptlet unless the class was in a package. I would receive the
following errors (from a scriptlet instantiation) :
com.sun.jsp.JspException: Compilation
failed:work\%3A80%2F\test_jsp_2.java:71: Class
H_0003a.barrack_00020website.develop.webpages.debug.Test not found.
Test drew = new Test();
^
work\%3A80%2F\test_jsp_2.java:71: Class
H_0003a.barrack_00020website.develop.webpages.debug.Test not found.
Test drew = new Test();
The usebean error was similar. I was surprised by this, but the JSP 1.0
reference card appears to back this up. All references and examples for
the <jsp:usebean> tag always use "package.class" notation. Perhaps one
of the Javasoft/Tomcat people can settle this for us?
Regards
Drew
> -----Original Message-----
> From: Praveen Kumar S . [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, November 25, 1999 2:05 PM
> To: Drew Cox; [EMAIL PROTECTED]
> Subject: RE: Running a JSP
>
> Hi,
>
> I beg pardon i do know it,
> but if it is not understood that the answer you have given is not
> taken care
> of,
>
> but i was not refrering to a package structure,
>
> (for hypothetication)
> i dont have a package structure, i want to keep it in the main beans
> directory
>
> it does not work, i have to use a package format, only. can you pls
> help me
> out as why. i have to use a package structure only
>
> regards amit
>
> > -----Original Message-----
> > From: Drew Cox [SMTP:[EMAIL PROTECTED]]
> > Sent: Thursday, November 25, 1999 8:52 AM
> > To: 'Praveen Kumar S .'; [EMAIL PROTECTED]
> > Subject: RE: Running a JSP
> >
> > Sorry to disagree with your here Amit, but I don't like seeing
> > mis-information spread on Java and JSP by it's own users. That's
> M$'s
> > job....
> >
> > This is NOT an "inherent problem with jswdk", this is the design of
> the
> > Java package system. I suggest you and the original poster need to
> > brush up on your package and CLASSPATH knowledge. Trust me, once
> you
> > understand their relationships, it's all completely logical. Here's
> my
> > version, I'll be embarrased if it's wrong...
> >
> > The class path (either set as the CLASSPATH environment variable, or
> > using a command-line parameter to the java/jre command) lists the
> set of
> > directories and jar files files that the Java runtime will look in
> for
> > any classes referenced in you code. In later (from JDK 1.2 onwards,
> I
> > think) versions the standard/core API classes are automatically
> included
> > in the class path and do not need to be referenced explicitly.
> >
> > If you classes are in packages, then they need to exist under a
> > directory structure matching the package hierachy, either as
> physical OS
> > directories or directories within a Jar file. The parent of this
> > directory structure, or the jar filename itself, are what must be
> > referenced in the class path.
> >
> > eg.
> >
> > If my class path is set as :
> > set CLASSPATH = c:\beans
> > And my code access a class :
> > com.barrack.MyBean aBean = new com.barrack.MyBean( );
> > Then my bean class will need to live in the file :
> > C:\beans\com\barrack\MyBean.class
> >
> > All this is standard Java stuff, so it applies to JSP/Servlets and
> the
> > jswdk too.
> >
> > Regards
> >
> > Drew Cox
> > Barrack Consulting
> >
> >
> >
> > > -----Original Message-----
> > > From: Praveen Kumar S . [SMTP:[EMAIL PROTECTED]]
> > > Sent: Wednesday, November 24, 1999 6:42 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: Running a JSP
> > >
> > > Hi meera
> > >
> > > There is a inherent problem with jswdk
> > >
> > > you have to do this,
> > >
> > > create a subdirectory
> > > say mypackage
> > >
> > > put your jsp in it with its package as mypackage;
> > >
> > > then access it as "mypackage.mybean" in your jsp
> > >
> > > regards
> > >
> > > Amit
> > >
> > > > -----Original Message-----
> > > > From: Reeta Mittal [SMTP:[EMAIL PROTECTED]]
> > > > Sent: Wednesday, November 24, 1999 1:25 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: Running a JSP
> > > >
> > > > Hello Everyone,
> > > >
> > > > I am using JSWDK1.0.1 for JSP.
> > > > I am writting a test JSP in which I am using a test bean. Can
> anyone
> > > > please
> > > > tell me where I hav to place the Bean ?
> > > > I have placed the JSP in the example directory and BEAN in the
> > > WEB-INF
> > > > directory.
> > > > I have created a subdirectory under example directory and a
> > > subdirectory
> > > > under WEB-Inf directory.
> > > > I have used the JAVAC for compiling the bean.
> > > > I am getting
> > > > 500: Internal server error.
> > > >
> > > > Can anyone please help me for this....
> > > >
> > > > Regards,
> > > > Reeta
> > > >
> > > >
> > > > Regards,
> > > > Reeta
> > > >
> > > >
> > >
> ======================================================================
> > > ====
> > > > =
> > > > 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
===========================================================================
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