my dog learned polymorphism*
The moose likes JSP and the fly likes Calling Applet in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Calling Applet in JSP" Watch "Calling Applet in JSP" New topic
Author

Calling Applet in JSP

supriya riya
Ranch Hand

Joined: Feb 23, 2009
Posts: 41
I am not able to call a simple helloWorld applet from jsp page session.jsp.Browser shows error applet/nameof applet not inited.i tried using applet tag and jsp:plugin tag also but error i am getting is same.My applet is in another project GUIFormExamples in source file folder manoj its name is HelloWorld.I am calling it in project Firstpro in jsp page session.jsp.GUIFormExamples is java class file library type.Firstpro is web project.

session.jsp



HelloWorld.java
Amir Iqbal
Ranch Hand

Joined: Jun 23, 2007
Posts: 97
in my opinion, the flaw may be in follwoing line,



please be sure that "="/GUIFormExamples1/src/manoj/HelloWorld.class" and "/GUIFormExamples1/src/manoj" paths are right.


Regards,

i am Java +ve Now !
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41906
    
  63
"code" is a class name, not a file name, so it shouldn't contain any slashes - only package names and the class name, separated by dots, like you would use whenever a class name is used.

"codebase" should be left out if the hierarchy of class directories is in the the same directory as the HTML page.

This section of the Java Tutorial talks about the applet tag in detail.


Ping & DNS - my free Android networking tools app
supriya riya
Ranch Hand

Joined: Feb 23, 2009
Posts: 41
Still i am not getting applet in jsp.I would like to mention again that jsp is in one project it is web project and applet is in another project that is a Java Class Library project.Both are in same workspace.Is this anything to do with HelloWorld.class file's location?

i tried following



i have used "." package separator and directory path for where my applet is for codebase

 
Don't get me started about those stupid light bulbs.
 
subject: Calling Applet in JSP