![]() |
Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
I'm going to assume that you have some experience with HTTP in general. If not, that's OK; just let me know if I haven't explained myself fully enough. You have a couple of good choices, depending on how much information you need to send between the two. If you're sending a small amount of information, you may just want to pass it as a request parameter to the servlet via an HTTP GET. From the applet, you would do something like:
On the servlet side, you would call the method ServletRequest.getParameter("msg") to get the value passed from the applet. If you're sending a larger amount of data, you will want to use the stream methods of URLConnection (on the applet side) along with ServletRequest.getInputStream(). Note that neither of the two techniques are appropriate if the data is sensitive. The transfered data is easily visible to others on the web. If you're looking to get started with servlet developement, I highly recommend Java Servlet Programming by Jason Hunter and William Crawford. You can get it directly from O'Reilly.
Replies: |
Sponsored Links
|