This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Applets and the fly likes Can applet use the jar file in the WEB-INF/lib Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Can applet use the jar file in the WEB-INF/lib" Watch "Can applet use the jar file in the WEB-INF/lib" New topic
Author

Can applet use the jar file in the WEB-INF/lib

Kidd He
Ranch Hand

Joined: Sep 17, 2006
Posts: 65
My applet is in the root of my application-----myapp/
But it will call a class in another package which will also be imported by the classes in the WEB-INF/classes.So I make that package into a jar file and put tha jar in the WEB-INF/lib.
When I run myapp, the applet can't work correctly,but the class in the WEB-INF/classes work well.Why?
If the applet can't call the classes in the WEB-INF/lib or WEB-INF/classes, how can I achieve the following function: the applet and the class in the WEB-INF/classes can call a class file together?
Thank you!!!


SCJP1.4 93%<br />SCWCD��
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41073
    
  43
You can't. See my post in this similar thread.


Ping & DNS - my free Android networking tools app
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

Are you asking why a file running on a client machine can't access a file running on the server?

An applet runs on the client JVM. Servlets and related code run on the Server. Those are two totally different JVMs. That's a big problem.

-Cameron McKenzie
Kidd He
Ranch Hand

Joined: Sep 17, 2006
Posts: 65
Thanks you all!!!
 
 
subject: Can applet use the jar file in the WEB-INF/lib
 
Similar Threads
About Deployment in WEB-INF/
Doubt in WEB-INF/lib
Can a class outsiad the ../WEB-INF/ call the class under ../WEB-INF/?
Best place for .properties file?
Where should I put the applet?