Solved

Listing all applet parameters?

Posted on 1998-11-12
6
215 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

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 …
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…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

717 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