Re: Applet not initiated

2007-03-26 Thread Tomcat

Hello Rashmi,

Thanks for response,

I put the class file in ROOT directory, the same place that my html file
exist , but still the same problem.

is it possible classpath should include that class location so 
computer's jvm

recognize the place that class is exist ?
and also I found some document that it says
codebase tag should cotnain the directory that class are located and 
code tag should contain

the class name but without class.

your help will be highly appreciated.


Rashmi Rubdi wrote:

Place your Applet's class file anywhere but the WEB-INF folder,
because WEB-INF folder is protected from client/browser's access,
applet classes can't be accessed if they are under WEB-INF.

Also use jsp:plugin tag , if you are accessing the Applet from a JSP 
file.


-Rashmi

On 3/25/07, Tomcat [EMAIL PROTECTED] wrote:

class file is located in tomcat WEB_INF/classes and I am calling it from
ROOT directory and through index.html file.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Applet not initiated

2007-03-26 Thread Rashmi Rubdi

You're welcome.


is it possible classpath should include that class location so
computer's jvm
recognize the place that class is exist ?


I recommend not setting the CLASSPATH at all.

I tested one Applet example with JSPs, and the applet loads fine on
Tomcat 6 / Windows XP without any explicit classpath settings.

Here's the code that works with JSP 2.0 if it helps you, the HTML
APPLET tag's syntax may be similar to the jsp:plugin tag's syntax as
shown below:

-
C:\dev\projects\MyProject\appletTest.jsp
-
%@ page contentType=text/html;charset=UTF-8 language=java %
html
headtitleApplet Test/title/head

body
%--
http://java.sun.com/products/jsp/syntax/2.0/syntaxref2023.html#1004158
--%

jsp:plugin type=applet code=HelloWorld codebase=.
   jsp:params
   jsp:param name=commaSeparatedValues value=abc,xyz,123,888/
   /jsp:params
/jsp:plugin
br/br/br/

%-- The following will not work, because HelloWorld2 is under WEB-INF --%
%--
jsp:plugin type=applet code=HelloWorld2 codebase=/WEB-INF/classes/test51
/jsp:plugin
--%

/body
/html

--
I've placed the applet class in the same folder as the JSP file, but it could
be placed anywhere else under the project (except under WEB-INF)

C:\dev\projects\MyProject\HelloWorld.java
--

import javax.swing.JApplet;
import java.awt.Graphics;

public class HelloWorld extends JApplet {

   public void paint(Graphics g) {

g.drawRect(0, 0,
   getSize().width - 1,
   getSize().height - 1);

   g.drawString(Hello world!, 5, 15);

   }
}

Cheers
-Rashmi

On 3/26/07, Tomcat [EMAIL PROTECTED] wrote:

Hello Rashmi,

Thanks for response,

I put the class file in ROOT directory, the same place that my html file
exist , but still the same problem.




and also I found some document that it says
codebase tag should cotnain the directory that class are located and
code tag should contain
the class name but without class.

your help will be highly appreciated.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Applet not initiated

2007-03-26 Thread Rashmi Rubdi

Also I don't know if you're using strict XHTML.

The applet tag is not supported in XHTML as mentioned here :
http://www.w3schools.com/tags/tag_applet.asp

they recommend using the HTML object tag
http://www.w3schools.com/tags/tag_object.asp instead of applet tag.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Applet not initiated

2007-03-25 Thread Rashmi Rubdi

Place your Applet's class file anywhere but the WEB-INF folder,
because WEB-INF folder is protected from client/browser's access,
applet classes can't be accessed if they are under WEB-INF.

Also use jsp:plugin tag , if you are accessing the Applet from a JSP file.

-Rashmi

On 3/25/07, Tomcat [EMAIL PROTECTED] wrote:

class file is located in tomcat WEB_INF/classes and I am calling it from
ROOT directory and through index.html file.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]