Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot load applet

 
rajshkhr pandey
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.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring 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: 2907
1
Java Spring 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: 2907
1
Java Spring 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic