tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Goss <mg...@rtci.com>
Subject Re: calling an applet from within a servlet.
Date Mon, 25 Sep 2000 14:40:49 GMT
Very true,
You do have to be careful though... You cannot place applets under the
WEB-INF dir and expect them to get loaded by the browser. That is only
for servlets and other server-side executable code.
Matt

William Brogden wrote:

> A more nearly universal solution is to insert a <base> tag in the
> <head> section of the page. This tag can specify the URL for locating
> class files as well as graphics, etc.
>
> The cause of the problem is that the browser sees the page as
> originating at /servlets/whatever and therefore tries that address
> when requesting class or image files.
>
> Matt Goss wrote:
> >
> > ashok,
> > Actually that won't work. You need to put it anywhere under in the
> > "webapps/<contextname>/" except under the WEB-INF dir. I suggest
> > using the full URL at first to call it. ie:
> > you have applet (myapplet.class) under "webapps/mycontext/applets/"
> > dir, and your servlet (located somewhere under WEB-INF dir) will
> > pass off an HTML page calling the applet like this:
> > <html><head><title>appletpage</title></head><body>
> > <DEFANGED_applet code="myapplet.class"
> > codebase="http://mydomain/mycontext/applets/"></applet>
> > </body></html>
> >
> > WThompson@gerbertechnology.com wrote:
> >
> > > try the servlets directory
> > >
> > > -----Original Message-----
> > > From: ashok v. shah [mailto:ashok_shah25@rediffmail.com]
> > > Sent: Monday, September 25, 2000 6:14 AM
> > > To: tomcat-user@jakarta.apache.org
> > > Subject: calling an applet from within a servlet.
> > >
> > > hi there..
> > > i am generating an html page with a servelt.. and want that page
> > > to load an
> > > applet. but the messge which i am getting is .class file(of the
> > > applet which
> > > i am trying to load) not found. i have tried placing that .class
> > > file in
> > > many different directories of the java web server but in vain. so
> > > i would be
> > > obliged if you can help me out of this problem..
> > > waiting for a reply..
> > > thanking you.
> > > ashok
> > >
> > > _________________________________________________
> > > Get Your Free Email At, http://www.rediffmail.com
> > >
> > > For fabulous shopping deals visit:
> > > http://www.rediff.co.in/shopping/index.html
>
> --
> WBB - wbrogden@bga.com  Chief Scientist, LANWrights, Inc.
> Java Programmer Certification information and mock exam
> at  http://www.lanw.com/java/javacert/

Mime
View raw message