On Fri, 27 Oct 2000, Heakyung Park wrote:
> Hello! I have tried several approaches suggested. However, I am
> still having same problem. My problem is that I placed applet and
> html in the same directory, and when I call the html file (that has
> <applet> tags) from other servlet. All other materials is displayed
> properly, except the applet, and I am getting "applet cannot be
> loaded!" Any suggestion! Thanks in advance. My applet doesn't
> communicate with any other resources at all for now, it just
> displays a chart.
Why don't you try getting it working without the servlet first -- that
should help get you going, and eliminate some variables as being the
cause of the problems. That is, set up a static HTML file, in a
regular, non-servlet directory, with the APPLET tags, and get that
working. You can probably do it with the applet class files in the
same directory as the HTML file, or in separate directory, using
appropriate settings for the CODEBASE attribute.
> On Tue, 24 Oct 2000, Heakyung Park wrote:
>
> > I stored the applet in the same directory as the servlet is located. My
> > problem is not finding the applet to be loaded, it is that "the applet
> > cannot be loaded." I tried the code base approach, if the browser doesn't
> > find the applet, the message says "the applet cannot be found." I hope I
> > didn't misunderstand you. Thanks.
> >
> >
> > On Tue, 24 Oct 2000, Milt Epstein wrote:
> >
> > > On Tue, 24 Oct 2000, Heakyung Park wrote:
> > >
> > > > So you mean the reason I am having the problem is due to my code? No other
> > > > possible reason?
> > > >
> > > > The following is the servlet code to display java applet;
> > > > import java.io.*;
> > > > import javax.servlet.*;
> > > > public class gan extends GenericServlet {
> > > > public void service (ServletRequest request, ServletResponse
> > > > response) throws ServletException, IOException {
> > > > response.setContentType("text/html");
> > > > PrintWriter pw = response.getWriter();
> > > > pw.println("<html><head><title>Gentt Chart</title></head><body>");
> > > > pw.println("<h1>Project Schedule in Gantt Chart</h1>");
> > > > pw.println("<applet code=\"gantt\" width=500 height=500></applet>");
> > > > pw.println("</body></html>");
> > > > pw.close();
> > > > }
> > > > }
> > > [ ... ]
> > >
> > > I suspect the problem is that the browser cannot find the applet code
> > > to (down)load. The way you have it above, the applet code is expected
> > > to be in the same "directory" as the html page, but that html was
> > > generated by a servlet, so it's in the servlet virtual directory. I
> > > think you need to specify a directory via the CODEBASE attribute on
> > > the APPLET tag that will tell the browser where to find the applet
> > > code. (The exact value of which depends on where the applet code is.)
> > >
> > > Milt Epstein
> > > Research Programmer
> > > Software/Systems Development Group
> > > Computing and Communications Services Office (CCSO)
> > > University of Illinois at Urbana-Champaign (UIUC)
> > > [EMAIL PROTECTED]
> > >
> > > ___________________________________________________________________________
> > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> > > of the message "signoff SERVLET-INTEREST".
> > >
> > > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > > Resources: http://java.sun.com/products/servlet/external-resources.html
> > > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
> > >
> >
> >
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html