You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Frank Peng <fr...@yahoo.com> on 2000/06/18 19:10:48 UTC
how to invoke an Applet from a Servlet program?
Hi, guys!
In Tomcat, it is no problem to call an applet from a
static page like this:
<html>
...
<applet code="helloworld.class" width=....> </applet>
...
</html>
When I poke this page with a browser, the applet
works.
But I can not load an applet by a servlet program like
this:
doGET {
.....
out.println("<html>");
....
out.println("<applet> code=\"helloworld.class\"
width=...</applet>");
out.println("<html>");
}
I tried to put helloworld.class in directory /classes
and everywhere I can try. The browser just say can not
find class helloworld.
Please help!
Frank Peng.
__________________________________________________
Do You Yahoo!?
Send instant messages with Yahoo! Messenger.
http://im.yahoo.com/
Re: how to invoke an Applet from a Servlet program?
Posted by William Brogden <wb...@bga.com>.
The solution is to specify a BASE for relative addressing
that points to the directory where things like applet
classes and images live. The BASE tag goes in the <HEAD>
area.
<base href="yadddayadda" />
Frank Peng wrote:
>
> Hi, guys!
>
> In Tomcat, it is no problem to call an applet from a
> static page like this:
>
> <html>
> ...
> <applet code="helloworld.class" width=....> </applet>
> ...
> </html>
> When I poke this page with a browser, the applet
> works.
>
> But I can not load an applet by a servlet program like
> this:
>
> doGET {
> .....
> out.println("<html>");
> ....
> out.println("<applet> code=\"helloworld.class\"
> width=...</applet>");
> out.println("<html>");
> }
>
> I tried to put helloworld.class in directory /classes
> and everywhere I can try. The browser just say can not
> find class helloworld.
>
> Please help!
>
> Frank Peng.
>
> __________________________________________________
> Do You Yahoo!?
> Send instant messages with Yahoo! Messenger.
> http://im.yahoo.com/
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
--
WBB - wbrogden@bga.com Chief Scientist, LANWrights, Inc.
Java Programmer Certification information and mock exam
at http://www.lanw.com/java/javacert/
RE: session problems
Posted by John Greb <jg...@home.com>.
Alex,
For this application I'm not using JSP's. I wrote this app a while back
using my own page compiler (before JSP's), maybe I'll convert it to JSP's
one of these days.
Anyway, At this time, I'm using the HttpSession class in the servlet API.
I'm assuming that cookies are used by the HttpSession class. Under Gefion's
LiteWebServer, a session id is sent to the browser as a cookie. I don't see
the cookie/session id being sent to the browser using Tomcat.
John
-----Original Message-----
From: Alex Tang [mailto:altitude@airflash.com]
Sent: Sunday, June 18, 2000 6:14 PM
To: tomcat-user@jakarta.apache.org
Subject: Re: session problems
how is your application setup?
Are you calling a servlet from the browser and then having the servlet use
"RequestDispatcher.include()" to send the request on to a JSP file?
if you are, try using "RequestDispatcher.forward()". There is (an
unconfirmed)
bug with RequestDispatcher.include() where session information is lost.
...alex...
John Greb wrote:
> Hello,
>
> I'm trying to run a servlet that ran great under Gefion's LiteWebServer
but
> seems to be having problems with Tomcat using cookies. The cookie's
session
> id is not being sent to the browser. Any clues...
>
> I'm running Windows NT Workstation 4.0, SP4, JDK1.3, and the latest
version
> of Tomcat. Tomcat is running in the stand alone mode. Also, I'm using IE5.
>
> Any help would be appreciated.
>
> Thanks, John
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
--------------------------------------------------------------------------
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org
Re: session problems
Posted by "Eric H." <eh...@usc.edu>.
It seems like when I tried using RequestDispatcher.include() it didn't
create/send any headers. I tried manually creating them and adding a
Cookie with the JSESSIONID, but it didn't quite work... I'm not certain if
it would or not. I ended up using the forward method also...
On Sun, 18 Jun 2000, Alex Tang wrote:
> how is your application setup?
>
> Are you calling a servlet from the browser and then having the servlet use
> "RequestDispatcher.include()" to send the request on to a JSP file?
>
> if you are, try using "RequestDispatcher.forward()". There is (an unconfirmed)
> bug with RequestDispatcher.include() where session information is lost.
>
> ...alex...
>
> John Greb wrote:
>
> > Hello,
> >
> > I'm trying to run a servlet that ran great under Gefion's LiteWebServer but
> > seems to be having problems with Tomcat using cookies. The cookie's session
> > id is not being sent to the browser. Any clues...
> >
> > I'm running Windows NT Workstation 4.0, SP4, JDK1.3, and the latest version
> > of Tomcat. Tomcat is running in the stand alone mode. Also, I'm using IE5.
> >
> > Any help would be appreciated.
> >
> > Thanks, John
> >
> > --------------------------------------------------------------------------
> > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commmands, email: tomcat-user-help@jakarta.apache.org
>
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
>
>
>
-Eric Harashevsky, USC ISD Student Consultant
Re: session problems
Posted by Alex Tang <al...@airflash.com>.
how is your application setup?
Are you calling a servlet from the browser and then having the servlet use
"RequestDispatcher.include()" to send the request on to a JSP file?
if you are, try using "RequestDispatcher.forward()". There is (an unconfirmed)
bug with RequestDispatcher.include() where session information is lost.
...alex...
John Greb wrote:
> Hello,
>
> I'm trying to run a servlet that ran great under Gefion's LiteWebServer but
> seems to be having problems with Tomcat using cookies. The cookie's session
> id is not being sent to the browser. Any clues...
>
> I'm running Windows NT Workstation 4.0, SP4, JDK1.3, and the latest version
> of Tomcat. Tomcat is running in the stand alone mode. Also, I'm using IE5.
>
> Any help would be appreciated.
>
> Thanks, John
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
session problems
Posted by John Greb <jg...@home.com>.
Hello,
I'm trying to run a servlet that ran great under Gefion's LiteWebServer but
seems to be having problems with Tomcat using cookies. The cookie's session
id is not being sent to the browser. Any clues...
I'm running Windows NT Workstation 4.0, SP4, JDK1.3, and the latest version
of Tomcat. Tomcat is running in the stand alone mode. Also, I'm using IE5.
Any help would be appreciated.
Thanks, John