Solved

Listing all applet parameters?

Posted on 1998-11-12
6
177 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now