Announcement

Collapse
No announcement yet.

Applets in JSP

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Applets in JSP

    Wie muss der Pfad beim CODEBASE aussehen, wenn ich ein Applet in JSP einbinden möchte.

  • #2
    <jsplugin type="applet" code="NervousText.class" codebase="/applets/NervousText" height="50" width="375"/>
    <params>
    <param name=text value="..." >
    </params>
    <fallback>Error</fallback>
    </jsplugin&gt

    Comment


    • #3
      Das probieren wir seit drei Tagen. Was ist unsere CODEBASE??

      Comment


      • #4
        Wie ist die Frage gemeint?
        Meinst Du "Was ist überhaupt bei einem Applet eine Codebase" oder meinst Du "Wie setzt man bei einer JSP-Seite die COdebase eines Applets"

        Comment


        • #5
          Hi,
          <p>die CODEBASE gibt optional ein Dir. an, von dem das Applet geladen werden soll. Der default ist immer das Dir. in dem die HTML-Seite bzw. JSP steht. Es geht also auch ohne CODEBASE, wenn JSP und Applet.class im gleichen Dir. stehen.
          <pre>
          <%-- Die JSP liegt in %TOMCAT_HOME%/webapps/<app>/jsp --%>
          <html>
          <head>
          <title>LoadApplet.jsp</title>
          </head>
          <body bgcolor="beige">
          <h1>LoadApplet.jsp</h1>
          <h3>aus dem current Dir, in dem auch die JSP liegt.<br>
          <%= request.getServletPath() %><br>
          <%= request.getContextPath() %><br>
          <%= request.getRealPath("/jsp") %></h3>
          <APPLET CODE="AppletLoad.class" WIDTH="100" HEIGHT="50" >
          </applet>
          <hr>

          <h3>jetzt mit Codebase</h3>
          <APPLET
          CODE="AppletLoad.class"
          CODEBASE="../applets"
          WIDTH="100"
          HEIGHT="50" >
          </applet>
          <hr>
          </body>
          </html>
          </pre>
          Im o.a. Beispiel gibt es unter dem Webapp-Dir. zwei Subdirs, jsp und applets. 2 Applet-Class Dateien müssen je in jsp und in applets stehen.
          <p>
          Die Aktion plugin brauchst du nur, wenn du in deinem Applet neuere API-Aufrufe hast (höher 1.1.4).
          <p>Gerhar

          Comment


          • #6
            sorry der code ging mal wieder voll daneben.
            <br>
            beschwer dich beim sysop, ich habe keine lust das umzuformatieren
            <pre>
            APPLET CODE="AppletLoad.class" WIDTH="100" HEIGHT="50"
            </pre>
            das reicht jedenfall

            Comment

            Working...
            X