Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Applet parameters - ignore case? (http://www.velocityreviews.com/forums/t647272-applet-parameters-ignore-case.html)

Andrew Thompson 12-04-2008 11:37 PM

Applet parameters - ignore case?
 
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?

--
Andrew Thompson
http://pscode.org/

Joshua Cranmer 12-04-2008 11:53 PM

Re: Applet parameters - ignore case?
 
Andrew Thompson wrote:
> 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%28java.lang.String%29>:
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]

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth

Andrew Thompson 12-05-2008 12:21 AM

Re: Applet parameters - ignore case?
 
On Dec 5, 10:53*am, Joshua Cranmer <Pidgeo...@verizon.invalid> wrote:
....
> <http://java.sun.com/javase/6/docs/api/java/applet/Applet.html#getPara...>:

....
> * * */The name argument is case insensitive./


Well slap me silly. Note to self - RTFM.

Thanks Joshua.

--
Andrew Thompson
http://pscode.org/

Roedy Green 12-05-2008 02:09 AM

Re: Applet parameters - ignore case?
 
On Thu, 4 Dec 2008 15:37:16 -0800 (PST), Andrew Thompson
<andrewthommo@gmail.com> wrote, quoted or indirectly quoted someone
who 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?


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)

Andrew Thompson 12-05-2008 03:19 AM

Re: Applet parameters - ignore case?
 
On Dec 5, 1:09*pm, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:

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


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).

--
Andrew Thompson
http://pscode.org/


All times are GMT. The time now is 07:23 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.