NetTalk Central

Author Topic: NT9.06 call applet  (Read 3595 times)

Sibuya

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • Email
NT9.06 call applet
« on: March 23, 2016, 03:24:37 PM »
Hi,

Is there anyone that worked with an applet? Is that possible?

I have a jsp page and need to turn into NT page to consume the applet inside with variables and return value. This is a sample of a jsp page:

<%@page session="false" %>
<script language="javascript">

   function doInit() {
      // do something
   }
   function myResponse(){
      // do something
      return true;
   }
</script>

<html>
   <head>
   </head>
        <body>
                  <h3>Test</h3>
       </body>
      <form method="post" action="doit" name="myForm" onsubmit="return(myResponse());">
         <input type="hidden" name="action" value="ProcessResponse">
         <input type="hidden" name="response" value="">
         <input type="submit" value="Click me" class=button name="doit2">
         <input type="button" onClick="doInit()" value="Init" class=button name="init">
      </form>

<%
    String version = (String)application.getAttribute("version");
%>

<applet id="oApplet" archive="my-applet.jar" code="classes/my.class" width="1" height="1">
    <param name="aaa" value="<%=version%>">
</applet>

</body>
</html>


Jar file has a path classes and my.class is inside.

I put "javascript" in a file.js, installed in script folder and declared in WebServer. Buttons I can create them inside a WebForm to perform apropriate actions. I donn't know how to declare variable parameters inside XHTML body. The Applet I'm trying to put in PageHeader WebForm, XHTML.

NT loads jar file but don't find my.class inside. I tried many variations but none worked.

Could anyone help me?

Thank you.

Cheers,

Marcos

Sibuya

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
    • Email
Re: NT9.06 call applet
« Reply #1 on: May 27, 2016, 11:14:22 PM »
Hi,

Yes, it's possible and it worked in a certain way.

It's unsecure and soom all browsers should ban Applets leaving Java Script that should be used for long time.

I have to use it because it was the option that 3rd party offered me to get to work to read certificates in smart card at client side.

An applet is used like any file or image to be used in you NT application. Just put .jar file in a folder and point to it to browser load when loading HTTP page. Declare the applet as earlier example and you should interface with Java Script.

But in NT app you have an issue. In server log screen you could see a bunch of messages showing that browser is  trying to access other internal classes that it could not find in server. Seems to be that browser is trying to find those classes in a path not inside jar but in server path. A way to bypass it you can extract classes from jar and build folders in a way that NT Server can find and provide to browser. It all depends on how applet was built.

Cheers,

Marcos