Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Applet not inited message in JSP... what may be the reason  RSS feed

 
Karthikeyan Ravindran
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<jsp:plugin type="applet" code=".\toolbar.class" codebase="c:\Documents and Settings\home\myDocuments\.\NetBeansProjects\Project\build\web\WEB-INF\classes" jreversion="1.6.0_03" width="400" height="350">
<jsp:fallback>Some Error
</jsp:fallback>
</jsp:plugin>

<h2>Hello World!</h2>
</body>
</html>

This is the code that i've written for running the applet in this JSP page.
THe class file of the applet is present in the path as indicated in codebase attribute of the plugin tag.when i run this page.. i get Applet not inited on the status bar. what could be the problem?

Thank You
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Files under the WEB-INF directory are not accessible to the web.
Applets are client side Java and can only access classes that are made available to them by the webserver.

 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Furthermore, the value of the codebase attribute should be relative to the HTML file that contains the applet, and not contain an absolute directory path.

Also, use code="toolbar" instead of code=".\toolbar.class".
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!