Solved

Listing all applet parameters?

Posted on 1998-11-12
6
203 Views
Last Modified: 2010-03-30
How can I get a list of all the parameters listed for an
applet in the HTML code?
0
Comment
Question by:mco
  • 3
  • 3
6 Comments
 
LVL 16

Expert Comment

by:heyhey_
ID: 1227255
i don't think you can get a list of all the parameters (except the broute force -
'test all strings'), but why do you need this kind of functionality ???

aplets are pieces of code that work with FIXED number of parameters and you can change
this parameters with simple HTML code, why do you need variable parameters to be passed

  there was some interesting article (i think JavaWorld) how to implement
  applet skeleton that finds out all his own fields (using reflection) and fills
  them with parameters from the APPLET tag

for example:
class MyApplet {
 
      public int param_counter;
      public String param_name;
      public String param_data;

      public void paramInit ()
      {
            ..
            ... // code
            ..
      }
  }

  and param init will check for all public fields, whose names begin with
  param_ an load them from appropriate parameters (if exist)
  (paramInit will check for parameters named "counter", "name" and "data" anf loads
  their values in the appropriate parameter (with appropriate  type)

  is this what you want to do ?
   heyhey

0
 
LVL 1

Author Comment

by:mco
ID: 1227256
The JavaWorld suggestion does not answer my needs.

The applet I am working on is quite big and the code is written by quite a few people.
It is actually just a Web implementation of an application.
We use many environment variables, which are implemented as system properties.
Their values are taken from the applet parameters.
It is true that we know the list, but since this project is quite big, in practice, any time someone
wants to add a new prameter (to be converted to a system propoerty) he has to notify
the person doing the conversions about it, and the latter has to modify his code.
It would have been much more convenient to be able and create all the required system properties, without knowing the full list in advance.

When using the program as an application there is no such problem.

0
 
LVL 16

Expert Comment

by:heyhey_
ID: 1227257
again, i don't think you can get a list of all the parameters, but i don't see how you can use this abstract list of parametere names + values (if you need such a list - then pass it as one parameter - not as a set of parameters)

when adding new parameters you have to add new logic - you don't need just abstract "give me all parameter names" information, ok ?
so changing the parameter list means changing the code, ok ? and somebody have to change the code "source time" - he can't add the new parameters information logic at run time...

so you have to change
- parameter list
- .java sources to handle the new parameters (its the parameter logic :)

JavaSofts article helps you to modify only the .java sources and InitParam will handle (load) parameters from the APPLET tag.

So - if you really need just a list of <paramName - paramValue> - then pass it as one APPLET tag parameter - not as a set of parameters

hope this helps ?
  heyhey
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:mco
ID: 1227258
This might be a good solution.
BTW, will this syntax work?

<PARAM name=details value=AAA=xxx BBB=YYY>

or will this work

<PARAM name=details value="AAA=xxx BBB=YYY">

0
 
LVL 1

Author Comment

by:mco
ID: 1227259
This might be a good solution.
BTW, will this syntax work?

<PARAM name=details value=AAA=xxx BBB=YYY>

or will this work

<PARAM name=details value="AAA=xxx BBB=YYY">

0
 
LVL 16

Accepted Solution

by:
heyhey_ earned 50 total points
ID: 1227260
i think
<PARAM name=details value="AAA=xxx BBB=YYY"> is better
but since you have to parse the value string yourself you may use some special separator char

(follows tag from javasoft main page )
<PARAM NAME=menu0 VALUE="0 0 25 14|435 0 25 14|0 0|d|/nav/new/index.html|What's New|/nav/new/index.html">

hope this helps
  heyhey

0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This video teaches viewers about errors in exception handling.

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question