Applet parameters - ignore case?

  • Thread starter Andrew Thompson
  • Start date
A

Andrew Thompson

I am in the process of writing an app. that can load applets
(it loads HTML, like AppletViewer, but then, different to
AppletViewer, it displays the HTML with applet*s* in a
JEditorPane). It is intended as a testing alternative to
AppletViewer.

In my app. at the moment, the parameter names need to
be the same case in the HTML, as they are in the Applet.
No browser I know of, enforces the case. Is there some
bit of the docs. I missed, that explicitly or implicitly allows
applet parameter names to be case insensitive?
 
J

Joshua Cranmer

Andrew said:
In my app. at the moment, the parameter names need to
be the same case in the HTML, as they are in the Applet.
No browser I know of, enforces the case. Is there some
bit of the docs. I missed, that explicitly or implicitly allows
applet parameter names to be case insensitive?

<http://java.sun.com/javase/6/docs/api/java/applet/Applet.html#getParameter(java.lang.String)>:
public String getParameter(String name)
Returns the value of the named parameter in the HTML tag. For
example, if this applet is specified as

<applet code="Clock" width=50 height=50>
<param name=Color value="blue">
</applet>

then a call to getParameter("Color") returns the value "blue".

/The name argument is case insensitive./

Parameters:
name - a parameter name.
Returns:
the value of the named parameter, or null if not set.
[emphasis added]
 
R

Roedy Green

In my app. at the moment, the parameter names need to
be the same case in the HTML, as they are in the Applet.
No browser I know of, enforces the case. Is there some
bit of the docs. I missed, that explicitly or implicitly allows
applet parameter names to be case insensitive?

see http://mindprod.com/jgloss/applet.html#APPLETTAGS

look at the PARAM section.
--
Roedy Green Canadian Mind Products
http://mindprod.com
"Humanity is conducting an unintended, uncontrolled, globally pervasive experiment
whose ultimate consequences could be second only to global nuclear war."
~ Environment Canada (The Canadian equivalent of the EPA on global warming)
 
A

Andrew Thompson


Thanks Roedy. Good page, as usual.

One or two typos.
"Applet parameter values are case sensitive (passed exactly as written
to your Applet’s getParameter. If you want lower case, use parmValue.)
toLowerCase()."

The second last ')' seems misplaced.
"Applet parameter values are case sensitive (passed exactly as written
to your Applet’s getParameter. If you want lower case, use
parmValue.toLowerCase())."

Two table rows down..
"and finally the ending tag for the"
"And finally the ending tag for the applet."

Oh, and while I was busy shoe-horning the APPLET
element into a HTMLEditorKit, I opened a page with
comments and saw your pet hate - the comment
appearing in the web page. If I get time I might
try and figure what needs doing to ignore those
HTML comments.

Another note that your links would be clickable
(by people who use a certain web interface to
post to usenet) if they were wrapped in '<' & '>'.

The line quoted above actually appears as..

seehttp://mindprod.com/jgloss/applet.html#APPLETTAGS

...in Google Groups (note the loss of the space).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top