tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ann patil" <patil...@hotmail.com>
Subject Re: Problem invoking 'Applet' from a servlet (passing parameters)
Date Mon, 09 Oct 2000 09:55:26 GMT
Tried this code but still getting the "class file not found" error.


out.println ("<HTML><head><base HREF=" + '"' + 
"http://localhost:8080/main/applet/" + '"' + "></head>");
			out.println ("<applet codebase=" + '"' + 
"http://localhost:8080/main/applet/" + '"' + " code=Abc.class >");
			out.println ("<param name=" + "userid" + "value=" + '"' + "Sam" + '"' + 
"> </applet></html>");


Anything else that I need to do?

Thanks

Ann.


>From: William Brogden <wbrogden@bga.com>
>Reply-To: tomcat-user@jakarta.apache.org
>To: tomcat-user@jakarta.apache.org
>Subject: Re: Problem invoking 'Applet' from a servlet (passing parameters)
>Date: Sun, 08 Oct 2000 08:18:24 -0500
>
>
>
>ann patil wrote:
> >
> > Hi,
> >
> > Directory Structure that I have on my side:
> >
> > abc
> > |
> > main  (root)    in server.xml <context>
> >     |
> >     applet
> >     1) Abc.java
> >     2) Abc.class
> >
> > Used the following code to invoke the applet from the servlet:
> >
> > out.println ("<HTML> <TITLE> Loading applet... </TITLE>");
> > out.println ("<applet codedebase="  "http://localhost:8080/main/applet/"
> > + " code=Abc.class >");
> > out.println ("<param name=" + "userid" + "value=" + '"' + "Sam" + '"' + 
>">
> > </applet></html>");
> >
> > Error after execution: 'error loading class file Abc.class' in the web
> > browser.
> > It searches for the class file in /main/servlet/  directory.
> >
> > Can anybody please help me out ?
> >
> > Am I missing something ? I need to pass parameters to my applet through
> > the servlet else I could had used the Redirect method.
> >
> > Is there a way out ?
> >
> > Thanks
> >
> > Ann.
>
>Remember that the browser is going to request those .class files
>the same way it requests images and other resources! NOT through
>your servlet but through the normal web server request.
>
>You could set the codebase to a normal directory but that
>still leaves a problem in loading images, etc.
>
>I suggest putting a <base> tag in the <head> area of the HTML
>page pointing to a normal web server directory.
>
>--
>WBB - wbrogden@bga.com  Chief Scientist, LANWrights, Inc.
>Java Programmer Certification information and mock exam
>at  http://www.lanw.com/java/javacert/

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


Mime
View raw message