| ServerEcho.jsb

netscape.samples.simple.ServerEcho.jsb

    <JSB>
    /*
     * ServerEcho.jsb    1.0 97/11/09
     *
     * Copyright (c) 1997 Netscape Communications Corporation
     *
     * Netscape grants you a non-exclusive, royalty free, license to use,
     * modify and redistribute this software in source and binary code form,
     * provided that i) this copyright notice and license appear on all copies of
     * the software; and ii) Licensee does not utilize the software in a manner
     * which is disparaging to Netscape.
     *
     * This software is provided "AS IS," without a warranty of any kind.
     * See the CDK License Agreement for additional terms and conditions.
     */

       /**
        * A simple server-side component for displaying the results
        * of a simple form submission from
        * <a href="pagelet.html">pagelet.html</a> packaged with the
        * component.
        * @see userName
        * @see userAge
        */
       <JSB_DESCRIPTOR NAME="netscape.samples.simple.ServerEcho"
        DISPLAYNAME="Server Echo" ENV="server"
        HELP_URL="netscape/samples/simple/ServerEcho_jsb.html">

       /**
        * n_s_s_ stands for netscape/samples/simple...
        * allows icon to sit in root of jar.
        */
       <JSB_ICON ICONNAME="n_s_s_ServerEcho">

       /**
        * userName property for display in the table
        * created upon construction.
        */
       <JSB_PROPERTY NAME="userName"
            TYPE="string" DEFAULT_VALUE="No userName specified">

       /**
        * userAge property for display in the table
        * created upon construction.
        */
       <JSB_PROPERTY NAME="userAge"
            TYPE="string" DEFAULT_VALUE="No userAge specified">

       <JSB_CONSTRUCTOR>

          /**
           * Simply writes out the userName and userAge passed as
           * params into a table
           */
          function netscape_samples_simple_ServerEcho(params) {
            write("<table width=50% bgcolor=#ffddee cellpadding=0 cellspacing=0 border=3>");
            write("<tr><th colspan=2 bgcolor=#eeddff>Your Responses</th></tr>");

            // Note that the "params.userName" is used in the line below
            // as the contents of the response cell
            write("<tr><th>Your Name:</th><td>"+params.userName+"</td></tr>");
            write("<tr><th>Your Age:</th><td>"+params.userAge+"</td></tr>");
            write("</table>");

          }

       </JSB_CONSTRUCTOR>
    </JSB>