Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Cannot load applet

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello to all,

I am developing an application, using JSF, in which I have used applet to upload the directory. But I am not able to load that applet in the browser.

My code is


It gives me error on the Browser's Java Console



I have created a jar file, sign it and put it in to the lib of my application.
I have also tried to change the codebase to my lib folder

Thanks in advance.
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use 'archive' attribute for loading the jar file.
 
rajshkhr pandey
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Sagar Rohankar wrote:Use 'archive' attribute for loading the jar file.



Yes, I have tried with "archive" attribute of applet but it gives me same error.
I think there is problem with codebase. How can I set the codebase to my jar file.

Thanks.
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, firstly I would suggest you to try using simple "applet" html tag and go through the basic applet configuration, also ponder on this basic cause:

Do you have that class available there, also google for the basic Java Applet example.
 
rajshkhr pandey
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Sagar,

I have tried the same applet code on the simple HTML page, it worked perfectly. I think because path to archive file is correct.
But when I insert the same code with JSF component, it gives the error.

I have placed the jar file in the lib folder and used archive as an attribute in the plugin tag to the jar file of applet code. Gives same error.
Also tried to put class file in to the classes folder to load applet, again gives same error.

thanks for reply.
 
Sagar Rohankar
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

rajshkhr pandey wrote:Hello Sagar,

I have tried the same applet code on the simple HTML page, it worked perfectly.


OK, fine, then copy that same folder having the HTML file into your web app root folder, like.

and access the html file as,
http://localhost:8080/MY_APP/YOUR_HTML_DIR/yourhtml.html

If this works then, you can have an idea what you need to setup for JSP/JSF file
 
A timing clock, fuse wire, high explosives and a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic