The compiler driver and classloader used by tomcat does a lot of magic to get it to work. All jsp files named, for example, index.jsp, will be compiled to a class named org.apache.jsp.index$jsp.java. It will be in a directory with the same name as the directory of the jsp file, but that's not represented in the package name.
The classloader knows where the class file will reside, and then strips out everything but the filename part of the URI, prepends org.apache.jsp to it, and loads that class. The base VM classloader CAN NOT load the generated class files. So debugging with an IDE that doesn't have special hacks is a bit difficult. Even if you can convince it to load servlets and debug that code, convincing it to set a breakpoint in some class named org.apache.jsp.index$jsp, and leaving it to figure out which one, is usually impossible. Unless things have changed recently, then go ahead and ignore all this. I know this applied for 4.0.3. > -----Original Message----- > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 20, 2002 1:28 AM > To: Tomcat Developers List > Subject: Re: jasper package > > > > > On Tue, 20 Aug 2002, [gb2312] Yunfeng Hou wrote: > > > Date: Tue, 20 Aug 2002 13:13:14 +0800 (CST) > > From: "[gb2312] Yunfeng Hou" <[EMAIL PROTECTED]> > > Reply-To: Tomcat Developers List <[EMAIL PROTECTED]> > > To: Tomcat Developers List <[EMAIL PROTECTED]> > > Subject: Re: jasper package > > > > > A desire to do this in the first place probably > > > comes from wanting to use > > > unpackaged classes without importing them -- which > > > is both against the JSP > > > spec and is also frowned on in general by the Java > > > compiler in JDK 1.4 and > > > later. You're MUCH better off putting your classes > > > > No, I want this because I need it to debug my > > generated class file at runtime. Currently, jasper > > will always generate class in org.apache.jsp. For > > example, /abc/test.jsp will have class in > > $scratchDir/abc, and /abc/def/test.jsp will be > > generated in $scratchDir/abc/def, with the same > > package - org.apache.jsp! I can not even compile these > > classes, do you think it a good design? > > > > Or, what I need is compile and debug, I do not need > > that flexibility to specify package name, at least, I > > think jasper should support this: these jsps will have > > package name org.apache.jsp.abc and > > org.apache.jsp.abc.def respectively. > > > > The Java compiler used by Tomcat doesn't have any problems compiling the > sources that are currently being generated. What compiler are you trying > to use that has problems with it? That's where your problem really > appears to lie. > > > > > Yunfeng Hou > > > > Craig > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > >
<<attachment: winmail.dat>>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>