aspose file tools
The moose likes Servlets and the fly likes Accessing one's own packages in servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Accessing one Watch "Accessing one New topic
Author

Accessing one's own packages in servlets

Abhishek Gautam
Greenhorn

Joined: Jan 12, 2008
Posts: 1
Guys, Please help me in acessing ones own packages in Servlets...
do we have to set the path for its classes...i am just the starter...
How will we do that...if thats the case?
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
Three ways I know of:

1. by command line
2. by environment variable
3. by options file
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1506
Update your classpath by adding the dirctory that your package is in to it. I.e the directory that's right above your package directory.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56151
    
  13

Of course setting the classpath is only useful for compiling the servlets and classes. The system classpath is ignored by the container serving the web application when deployed.

To deploy the classes, they must be place in one of the locations defined by the Servlet Specification. For example, WEB-INF/classes for standalone classes, or WEB-INF/lib for jar files. There are also container-defined locations to share classes across web apps.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Accessing one's own packages in servlets
 
Similar Threads
packages
Running Servlets, have a question
How many types of servlets are there
servlet deployment
Error allocating a servlet instance.