Including a jar file in another jar file in netbeans
I have created an applet and made its jar file in Netbeans. i am using a jar file in an applet. I am calling the applet.jar in a jsp page. The applet works fine but the functionality it has to be achieved is through the another jar file which i was using in that applet. means how to include an external jar file in applet.jar so that it could also be available to that jsp page also when i will run the jsp page开发者_JAVA百科.
If you just need to make a jar file available to your applet code, you can just host it from your server and reference it in the <applet>
tag. That might be easier than combining the jars, and easier to maintain.
There's a nice overview here, from which I take this example:
<applet code="main.class" codebase="/java" width="100" height="100" archive="applet.zip">
</applet>
...makes the classes in /java/applet.zip available to your application.
Update - the information about the APPLET tag in the Sun/Oracle documentation is comprehensive and easy to follow, i.e. http://docs.oracle.com/javase/1.4.2/docs/guide/misc/applet.html
精彩评论