Restriction: The Java Resources folder,
Java Resources:src by
default, in a Web project is for server-side classes, so the source code for
applets cannot be placed in this folder. Therefore the following is recommended
when developing applets:
- Create a Java project for applets and create the applet classes
in the project.
- Copy applet class files to the Web content folder. Do not copy them to
the WEB-INF folder since that folder is for server-side classes only. You
will need to change the Project Explorer view filters by selecting Filters from
the Menu drop-down list.
- Insert an applet in a Web page by selecting in
Page Designer. At that time you must set the appropriate code and codebase
attributes.
For example, if your applet class is aaa.bbb.AnApplet and the
file structure is as follows:
- WebContent/index.html
- WebContent/MyApplets/aaa/bbb/AnApplet.class
- code is aaa.bbb.AnApplet
Then the applet tag in index.html should contain:
Restriction: LinksBuilder might incorrectly flag the
code attribute value of an applet as an invalid link if a fully qualified Java classname
is used:<applet code="aaa.bbb.AnApplet" codebase="MyApplets"> This
warning can safely be ignored and does not affect the behavior of the applet
when it is run on the server. This warning can be avoided by using a slash
(/) instead of a period (.) as a separator, and ensuring that the class extension
is not explicitly stated. For example: <applet code="aaa/bbb/AnApplet"
codebase="MyApplets">