Java Applet embedded in a JSP Page


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Java Applet embedded in a JSP Page

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    Puerto Rico
    Posts
    15

    Exclamation Java Applet embedded in a JSP Page

    Hi

    I am trying to include a Java Applet into a JSP page in my SAP MI application. The code is as follows:

    <jsplugin type = "applet"
    code = "com.mycompany.applet.myApplet.class">
    </jsplugin>

    It gave me a Class Not Found exception. If I place the class in the same directory that the JSP resides it works properly. It seems that I need to set the codebase and/or archive property to work. But every value I use to set them still gaves me the CLASS NOT FOUND Exception. I am using MI2.5 and the jar file is located at MYAPPS/WEB-INF/lib folder. Any suggestion will be appreciated.

  2. #2
    Join Date
    Jul 2005
    Location
    SW MO, USA
    Posts
    299
    I assume that the class not found is from the Java plugin in the browser when it tries to load your applet.

    When the browser gets the HTML from the JSP page, it sees that it needs the applet class and issues an HTTP GET to the server for the class. It is possible with the archive attribute to specify a path to the class file.

    Can you see what the path is on the HTTP GET being sent to the server? If you could see that, you would know where to put the class files so the GET can find them.
    Does your server have a trace to show what it is receiving and returning?

    The default path for the browser to use when getting need files for an HTML page, is the one that it used to get the HTML page itself. Use the archive= to change that for the applet class files.

  3. #3
    Join Date
    Jul 2005
    Location
    SW MO, USA
    Posts
    299
    Whoops. I meant to say that the path to the jar file/class files should be in codebase= not archive=.

    I'm not familiar with your server and can't say how it uses the paths it receives with an HTTP GET. They could be mapped anywhere on the server. Best to read the server's doc.

  4. #4
    Join Date
    May 2004
    Location
    Puerto Rico
    Posts
    15
    Well after a little detour with a project I came back to this issue.

    I got it work properly using codebase and archive on my laptop. But when I try to call the page on the mobile device it gave me the following error:

    "Press OK to continue loading the content of the Page"

    and then nothing.

    The mobile device is using Pocket IE and CrEme for JVM. Do I need something else to make it work on the mobile device?

  5. #5
    Join Date
    May 2004
    Location
    Puerto Rico
    Posts
    15
    Solve it. It was something related to CrEme.

Similar Threads

  1. Java vs. .Net. A questionnaire
    By Basil in forum .NET
    Replies: 1
    Last Post: 05-13-2005, 07:46 AM
  2. Java applet to VB
    By Maurice in forum Java
    Replies: 0
    Last Post: 02-11-2003, 02:10 AM
  3. Learning JSP or ASP after Java:
    By JayinMichigan in forum Careers
    Replies: 2
    Last Post: 06-13-2001, 10:38 AM
  4. Java Applet won't work via browsers
    By Graham in forum Java
    Replies: 1
    Last Post: 02-20-2001, 02:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center