Solved

Listing all applet parameters?

Posted on 1998-11-12
6
210 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Cisco ASA: Java web start no go, asdm launcher no go 3 58
wild fly 8 startup error 2 43
import as existing maven project 3 41
junit example issue 2 28
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

726 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