MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
tadzio1
Post subject: Applet CODEBASE  PostPosted: Apr 02, 2005 - 11:00 PM
Registered Member
Registered Member


Joined: Mar 25, 2005
Posts: 6

Hi ,
I do not know what should be CODEBASE in the HTML code, generated by a servlet for an applet, which is coded under MyEclipse in the MyProject/src in a default package.

After deployment the class file of the applet is visible on a server ( like Tomcat 5 ) as:
webapps/MyProject/WEB-INF/classes/MyApplet.class , but I cannot guess what CODEBASE in the HTML code should be.
As an example consider the following code snippet of
http://servlets.com/jservlet2/examples/ch10/ChatDispatch.java
=========
// Print the HTML code to generate the applet.
// Choose the applet code based on the method parameter.
// Provide a user parameter if we know the remote user.
out.println("<APPLET CODE=" + applet + " CODEBASE=/ " +
"WIDTH=500 HEIGHT=170>");
==========
In the above snippet the command:
" CODEBASE=/ " does not work
and
" CODEBASE=WEB-INF/classes "
does not work - the applet is not loaded to the browser.
I tried also simpler applets than HttpChatApplet ( of the above example) , but without success.
Is it OK to keep the applet class file in the WEB-INF/classes , if not - where and how to put it ? And what about CODEBASE ?
Tad
 
 View user's profile Send private message  
Reply with quote Back to top
support-rkalla
Post subject:   PostPosted: Apr 04, 2005 - 04:29 AM
Registered Member
Registered Member


Joined: Jan 06, 2004
Posts: 23818

Moving to OT > Soft Dev, this is not an ME issue.


Tad, CODEBASE is just where the applet code lives, and it *must* be in a publically accessible place. Anything under WEB-INF is actually protected by the app server and not publically accessible, so that won't work. Try and put the class somewhere that you can actually hit the class file with your browser, once you've done that, just type in the whole path for the codebase, like:
CODEBASE=http://www.mydomain.com/applet/code

And then have your class files in the code directory.

_________________
Riyad
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
tadzio1
Post subject:   PostPosted: Apr 04, 2005 - 07:56 PM
Registered Member
Registered Member


Joined: Mar 25, 2005
Posts: 6

Thanks, Riyad
Now it is clear. One more newbie question:
Can I configure the build method - using only myEclipse menu - to automatically compile a selected source folder ( /applet_src ) to the /applet/code/applet.jar outside WEB-INF , as the regular src folder is automatically compiled inside WEB-INF .
Of course I may do it using Ant, but ... it is great in MyEclipse, that we do not need to use Ant !
Tad
 
 View user's profile Send private message  
Reply with quote Back to top
support-rkalla
Post subject:   PostPosted: Apr 04, 2005 - 08:11 PM
Registered Member
Registered Member


Joined: Jan 06, 2004
Posts: 23818

Quote:

Can I configure the build method - using only myEclipse menu - to automatically compile a selected source folder ( /applet_src ) to the /applet/code/applet.jar outside WEB-INF , as the regular src folder is automatically compiled inside WEB-INF .

I think you can also play with the File > Export > To JAR feature of Eclipse, that might do the trick too.

_________________
Riyad
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
tadzio1
Post subject:   PostPosted: Apr 05, 2005 - 12:02 AM
Registered Member
Registered Member


Joined: Mar 25, 2005
Posts: 6

Thanks for the trick.
I found also that it makes more sense to keep all the "applet source" in a seperate Java (not WEB ) project, with an output to the jar file.
Tad
 
 View user's profile Send private message  
Reply with quote Back to top
dejan.ristov
Post subject: What's the CODEBASE parameter  PostPosted: Mar 01, 2008 - 05:07 PM



Joined: Mar 01, 2008
Posts: 1

Hi,
I have the same problem with the same class :
http://servlets.com/jservlet2/examples/ch10/ChatDispatch.java

Can you tell me what did you write in the CODEBASE parameter ?
 
 View user's profile Send private message  
Reply with quote Back to top
amir55
Post subject:   PostPosted: Nov 15, 2008 - 08:05 PM
Registered Member
Registered Member


Joined: Oct 15, 2005
Posts: 216

hi Dear Riyad and all

1 - I have my codebase in the jsp as to refer to java class in com.corejsf package

I exported this class to a jar to place in the lib

my jsp applet related source as next

<jsp:plugin type="applet" code="English.class" codebase="com/corejsf/" width="475" height="350">
</jsp:plugin>


so the question how to access this applet using he codebase ?

2 - more to ask If I prefer NOT to keep the java applet in a jar so how to access it while Myeclipse automatically place classes in the WEB-INF ?

many thanks
Amir
 
 View user's profile Send private message  
Reply with quote Back to top
amir55
Post subject:   PostPosted: May 08, 2011 - 09:05 PM
Registered Member
Registered Member


Joined: Oct 15, 2005
Posts: 216

hi again

still no one has yet replied to my question to how to use the codebase in jsp to access the applet in side a pckage in the src

thnaks allot

Amir
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits