You can send multiple objects in a single request. On the applet side,
construct an ObjectOutputStream from the OutputStream for the connection, write
the objects you want to sent (which can include Strings giving information about
the transmission, for instance) to the ObjectOutputStream, and use the POST. On
the servlet side, construct an ObjectInputStream from the ServletInputStream,
read the objects in the same order they were written by the applet code, and
cast them back to the original types.
You can also set up a record containing all the items you want to transfer,
along the lines of:
public class Record
{
public String userName;
public String rudimentaryPassword;
public String nameOfFile;
public String nameOfSubdir;
...
}
Then set up all the information in an instance of this class on the client side,
output that to the ObjectOutputStream, and read it in on the server side. I
personally prefer to use pure data classes for this type of transfer, with no
methods defined, but that's a matter of taste.
- Dennis
Dennis M. Sosnoski
Sosnoski Software Solutions, Inc.
http://www.sosnoski.com
Sebastian Sager wrote:
>
> Hi !
>
> I got no response to yesterdays question so I figure it was rather
> stupid. Could anyone point our a URL where to read the basics about how to
> send serialized objects AND information about the transmission together?
>
> Thanks...
>
> Sebastian Sager
>
> Hello !
>
> I'm new to servlets so it's a very basic question I have. I want my
> applet to send some (serialized) objects and files to the servlet, so I
> use the Post method. But whats the best way to let the servlet know the
> parameters for the transmissions (like user name, rudimentary password,
> name of the file, name of the subdir to store data in...) ? I thought
> about successive GETs and POSTs, but that's not too elegant, is it ? And
> persistant connections ? Didn't really understand what you have to do to
> keep them :o(
>
> Thanks in advance for your help...
>
> Sebastian
>
> ___________________________________________________________________________
> 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