There is different way of passing information from
front end application(Applet and application)to the
middlewares( such as servlet and jsp).
you can use a javabean as a data container and fill
your information in it and write it to stream by using
diiferent method such "writeobject" and in the other
side use"Readobject" and get the pointer to the
object .The following code will help you.
Client side:
try
{
URL url=new URL(urlStr);
URLConnection con=url.openConnection();
con.setUseCaches(false);
con.setDoInput(true);
con.setDoOutput(true);
OutputStream out = con.getOutputStream();
ObjectOutputStream outStream = new
ObjectOutputStream(out);
outStream.writeObject(item);
outStream.close();
out.close();
InputStream in=con.getInputStream();
DataInputStream textStream=new DataInputStream(in);
textStream.close();
in.close();
}catch(Exception ex){
ex.printStackTrace() ;
}
server Side:
try{
InputStream in = request.getInputStream();
ObjectInputStream objStream;
objStream = new ObjectInputStream(in);
RequesterItem item= new RequesterItem();
item =(RequesterItem) objStream.readObject();
objStream.close();
in.close();