my dog learned polymorphism*
The moose likes Servlets and the fly likes import attribute and directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "import attribute and directory" Watch "import attribute and directory" New topic
Author

import attribute and directory

Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Hi, I have a question on using the page directive attribute "import", and the directory that contains the imported package. Should I put those packages to be imported in the classes directory? If not, where should I put them?
Thanks.
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

IMO, you can put them in the classes dir. Also, if you put
them in the classes directory you still need to follow the
package structure, if you have one.
You could also put them in the lib dir if they are already
in a jar file.
Any one else who can confirm what I said........
regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
My idea is that when a JSP page is translated into a servlet, that servlet goes into classes directory like other regular servlets. So, the regular servlets import packages from the classes directory. So does the JSP files?
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

that servlet goes into classes
directory like other regular servlets.

This may not be really true. It depends on the app server implementation, I would guess.
Under Tomcat, the generatedJavaServlet.[java, class] files
are located under the TOMCAT_HOME/work/localhost_8080???/
directory.
regds.
- satya
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
So, where should I place the com packages for JSP in tomcat?
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

I would think either classes or the same folder as the .jsp
One or the other should work.


SCJP
Visit my download page
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Thank you Randal, Satya.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: import attribute and directory
 
Similar Threads
Import
problem for all ..
k&b chapter 10, question 2
problem in "Page directive"
classpath help with examples