Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Aadil Ahmed

Greenhorn
+ Follow
since Dec 20, 2012
Aadil likes ...
Chrome Eclipse IDE Java
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Aadil Ahmed

It is resolved now, It was as simple as having the class files outside the WEB-INF folder.
The explanation is that the client's browser cannot access files inside the WEB-INF.

just remember to set codebase="."

Thank you Paul
5 years ago
Hi Paul, I tried using the WEB-INF/classes in the codebase it didnt work, i have the same error.
even tried placing the examapplet.class in the same folder as my jsp, that didnt work either.
any other suggestions?
5 years ago
Hi Guys, I would deeply appreciate any help from you.
In short, my applet does not load when i call it from jsp page.
I am using eclipse juno,Apache tomcat 7.x as the environment to develop the program.

the following is my jsp page. (examApplet.jsp)

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title>Exam Applet</title></head>
<body background="paper_bg.gif">
<center><h2>Online Exam</h2></center>
<center>

<jsp:plugin type="applet" code="examapplet.class" codebase="WEB-INF/classes" width="500" height="280">
<jsp:fallback>
<p> Unable to load applet </p>
</jsp:fallback>
</jsp:plugin>

</center>
</body>
</html>


I know i am messing up in the codebase part of the plug in.
the error is the same if i run the application on eclipse or export it to a war file and deploy it in apache.

i have tried both the <applet> tag and the <jsp:Plugin> tag, the applet tag displays nothing on the page where as the jsp:Plugin tag shows an empty box which loads the java run-time plugin on the browser and pops up a message saying class not found error.

my file system on eclipse is:
project>
.settings
build>
classes(all .class files are in this folder)
servlets>
(contains all my .java files)
webcontent>
(contains all the.jsp files)
META-INF
WEB-INF>
web.xml

the file system on creating a .war file is:
project>
(contains all .jsp files and images needed)
META-INF
WEB-INF>
classes(Contains all class files)
lib
web.xml

it is only the plugin function that doesnot work, the applet runs on its own if run as a java applet on eclipse.
I am not a pro at programming, i have really hit a roadblock. any help as soon as possible would be really appreciated.
attaching the screenshot of the webpage on the eclipse browser
5 years ago