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, Dec 4, 2008
    #1
    1. Advertisements

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

  3. Andrew Thompson, Dec 5, 2008
    #3
  4. Andrew Thompson

    Roedy Green Guest

    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. 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, Dec 5, 2008
    #5
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.