WelcomeTo
WelcomeTo

Reputation: 20591

How to put initial parameters into applet?

How to put into applet initial parameters without using this:

<param name="foo" value="bar"></param>

I don't want to use code written above, because applet must be used with big initial paramter: two arrays of Strings. Each array can contain up to 50 string elements. So i think it's bad to write this parameters into HTML page as:

 <param name="foo1" value="GUID #1"></param>
 <param name="foo2" value="GUID #2"></param>
 .....
 <param name="foo90" value="GUID #90"></param>

Upvotes: 0

Views: 144

Answers (3)

Joni
Joni

Reputation: 111349

Two ideas:

  1. Use just one parameter key and concatenate the values separated by commas, so you get something like:

    <param name="foo" value="GUID #1,GUID #2,GUID #3,....,GUID #90"></param>
    

    Then you split the value by commas in the applet code.

  2. Read the parameters from an external file. This is slightly more difficult because you have to create a URLConnection to read the parameters.

Upvotes: 1

Jayyrus
Jayyrus

Reputation: 13061

you could use

  PARAM NAME="myArray" VALUE="element1 element2 ... elementN" 

Upvotes: 1

Juvanis
Juvanis

Reputation: 25950

If you are not using just pure HTML, (i.e. using PHP, JSP or ASP etc.) why don't you generate them via loops? For example, PHP version could be like that:

for($i = 1; $i < 100; $i++)
    echo ("<param name='foo" + $i + "1' value='GUID " + $i + "'></param>");

Upvotes: 1

Related Questions