Applet parameters - ignore case?

Discussion in 'Java' started by Andrew Thompson, Dec 4, 2008.

  1. 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/
     
    Andrew Thompson, Dec 4, 2008
    #1
    1. Advertising

  2. 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
     
    Joshua Cranmer, Dec 4, 2008
    #2
    1. Advertising

  3. On Dec 5, 10:53 am, Joshua Cranmer <> 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/
     
    Andrew Thompson, Dec 5, 2008
    #3
  4. Andrew Thompson

    Roedy Green Guest

    On Thu, 4 Dec 2008 15:37:16 -0800 (PST), Andrew Thompson
    <> 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)
     
    Roedy Green, Dec 5, 2008
    #4
  5. On Dec 5, 1:09 pm, Roedy Green <>
    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/
     
    Andrew Thompson, Dec 5, 2008
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. A.M
    Replies:
    5
    Views:
    5,620
    subha
    Sep 23, 2011
  2. Mosas
    Replies:
    1
    Views:
    436
    Maarten Sneep
    Mar 22, 2005
  3. Morten71
    Replies:
    0
    Views:
    666
    Morten71
    Apr 2, 2007
  4. Replies:
    7
    Views:
    279
  5. Rob Meade
    Replies:
    6
    Views:
    297
    Rob Meade
    Mar 1, 2004
Loading...

Share This Page