Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem in resolving the class files the jar .

Status
Not open for further replies.

ilarum

Programmer
Aug 25, 2003
13
DE
Hi,
When we create a webapplication. We have the following structure.

MyWebApp
jsp files
html files
images logo.gif
WEB-INF web.xml
classes sample.class
test.class
lib dblibrary.jsr
xmlTools.jar

Now all the jars are nothing but the classes files packaged into one. Why do need to package classes are jars and place them lib directory why not place all the classes in classes folder itself.

One Question:
I have packaged some class files into a jar and placed them in the lib directory. I have a jsp that has calls these class inside jar file. But when i deploy and run this webapplication. there is a compile time error stating that unable to resolve class names. Why does this happen.

With Regards
Murali
 
1.Your structure seams to be accurate...upto a point.
the class files you put in "lib" directory, are they part of a package or default package? if they are in a package is the name of the jar file the same name as the package?

2. You could make any make a package-folder beneath the "classes" folder and have all the class files of that package in that folder provided they are all part of that package with same name as the folder itself.

3. The reason we use the jar file is that its only one file representing a package which could consist of many seperate class files. The jar approach is simpler for deploying and is compressed. Hence, takes less space on your web server space.

4. for the files you're unable to access...make youre they are in a package and that you refer to them with fully qualified name >>like mypackage.myclass

Libaax
Hakuna Matata....;)
 
hi,
Well I had the classes in a certain package. Then I jarred them and placed in the lib directory its perfectly fine right. I had an applet in these classes. A JSP had an applet embedded in it. But it says unable to resolve the classes why is it.

With Regards
Murali
 
With applets in jar files, you need to specify the actual archive name in the <applet> tag.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top