Doubts about applet's 'param' and an archive pointing to a jar

-1

I can not understand what this is in this applet, does anyone explain? And why does the applet have that archive that points to a jar? Why stop?

<applet code="TesteApplet.class" archive="agora.jar" width=160 height=120>
    <param name="campo" value="senha">
    <param name="formulario" value="formulario">
</applet>
    
asked by anonymous 18.04.2016 / 14:42

2 answers

1

The archive attribute is an optional one that describes one or more files that contain classes and other resources that will be "preloaded."

Parameters already specify the values that applet needs for initialization and for its correct display in the application. The HTML file lists parameters for the applet in the tags.

It's passed this way:

<param name=[nome] value=[valor]>

where [nome] indicates the name of the parameter, as expected by applet , and [valor] represents the information to be passed.

To retrieve the value of a parameter, you have to call the getParameter() method, passing the value of name as the parameter.

References:

link

link

    
18.04.2016 / 15:06
0

The param properties can be retrieved in the Applet code, as follows:

 String paramCampo = getParameter("campo");

Using your example HTML code, the value of the variable paramCampo in this case would be "password".

As for the archive attribute of the applet tag, it points to the Java program that has been encapsulated in the .Jar container and contains the applet.

    
18.04.2016 / 15:06