2005年1月14日
First, the applet would have to know the current
session id, so you would need to put the applet in a jsp, and
dynamically create an applet parameter that contains the session id.
Then
you would need to use a URLConnection to connect to the servlet, and
pass the session id to the server, either as a cookie value or using
url rewriting.
Once you have done that you can create
ObjectInputStream's and ObjectOutputStream's on both the applet and
servlet side to pass the required session variables.
Just note,
that this would mean the applet is actually going to download the
object to the client side, so it might be a bad idea if your
application runs over the internet. And this also means your applet
would need to be signed.
posted @
2005-01-21 17:37 LeighSword 阅读(545) |
评论 (0) |
编辑 收藏
Java technology (version 2) is both an object-oriented programming language and a platform developed by Sun Microsystems. Java technology is based on the concept of a single Java virtual machine (JVM) -- a translator between the language and the underlying software and hardware. All implementations of the programming language must emulate the JVM, thus enabling Java programs to run on any system that has a version of the JVM.
The Java programming language is unusual because Java programs are both compiled (translated into an intermediate language called Java bytecodes) and interpreted (bytecodes parsed and run by the JVM). Compilation occurs once, while interpretation happens each time the program is run. Compiled bytecode is a form of optimized machine code for the JVM; the interpreter is an implementation of the JVM.
posted @
2005-01-14 16:48 LeighSword 阅读(629) |
评论 (0) |
编辑 收藏