|
Some interactive facilities of web applications are realized in web development with the help of applets – special Java applications that run in the users' web browsers. The main purpose of applets is extension of interactive facilities of user web interfaces, therefore applets may be used for website development.
Applets increase the security of the site program code because they practically exclude the possibility of being attacked by malware. That is why in spite of the fact that applets today are considerably less popular than Flash technology, they still can be used by web developers.
For example, applets allow to create convenient interactive maps, animation, online games, various web forms. To embed applets into the HTML code of web pages a special tag is used – <applet>. The applet is embedded into the body of an HTML page (after the opening <body> tag); the <applet> tag is inserted in the part of the page where the web developer wants to place the corresponding applet. The applet embedding code syntax looks the following way::
<applet code=file_name.class width=n height=m>...</applet>
In this example “file_name.class” is the name of the downloaded file that contains the applet. The applet must be located in the same directory where the HTML page that references this applet is.
Applets may contain several additional optional attributes that may be used if needed. For example, the alt attribute sets the value of the alternative text in case the applet cannot be displayed for some reason. The vspace and hspace tags are responsible for the spaces between the applet and the rest of the HTML page content.
Applets have a reliable security system that protects the site from the malicious codes and minimizes the risk of being infected by a virus. For this purpose the developers of Java have created the so-called sandbox – a security mechanism that includes three main components:
- check on the JVM level;
- protection on the language level;
- JavaSecurity interface.
Modern web development also presupposes the use of ready-made applets for website development, as there exists a great number of such applications. Applets are cross-platform and cross-browser, they are downloaded very quickly. However, applets still have some disadvantages.
For instance, to display applets the browser must support Java (Java extensions are not always installed in the browser by default). Besides, applets are executed by JVM (Java Virtual Machine), therefore to launch an applet you should first wain until the JVM launches.
Modern web development of sites widely uses contemporary advanced technologies, and applets are rather a nice addition to the features of developed websites. Therefore applets are a common feature of entertaining sites and Web portals.
TAGS
web development,
applets,
website development,
applet,
java application,
web application |