Yes and no. That is yes what you describe can be made to happen but does not need to. If you subsitute a servelet for the CGI the servelet can actually create a java object (whatever it may be) and then serialize it and pass it over to the client as binary data. the client then "de-serializes" it and voila objects passed over http!. This could be very powerful when you think about it.
If the servlet is also an RMI server then it can create the stub and the skeleton. It can pass the stub over to the client which can then manipulate the remote object (if the RMI port is open).
If the port is closed then RMI is pretty much out of the question and you will have to deal with either text or serialized objects being passed around.
IMHO it is best to deal with text. I have created an API of sorts. So the server CGI gets a request like command=1&data=somestring and it executes what ever the 1 comand is passing the somestring parameter to it. The return value is allways x,somestring where x is an exit status and somestring is the meat of the result. Sometimes I use simple XML like structures ( < double > 2.0 < /double > ) other times I just send over data like this 1|2|3~1|2|3 to represent a recordset. I kind of used WDDX http://www.wddx.org
as a basis for my XML specs. Also there are some cool white papers at inprise http://www.borland.com/jbuilder/papers/jb2servlet/
if you have time to read white papers.
[This message has been edited by Tim Uckun (edited September 15, 1999).]