Sending a serialized object from a Java program to a servlet

I need to send a Java object from my Java program to Servlet. I was thinking of doing this through serialization. Is there any other thing that I can use to send a Java object to Servlet. If this is through serialization, you can give me a link for reference.

thanks for the help

+3
source share
5 answers

Use HttpURLConnection, create a POST request and before connecting to the server, get outputStream from HttpURLConnection, wrap it with ObjectOutputStream and write your object on it.

You will need to do the opposite on the server side.

+7
source

Java , - , .

, , . , , , JSON XML Java.

+3

RMI. .

0

:

http://www.javaworld.com/javaworld/javatips/jw-javatip103.html http://www.cs.unc.edu/Courses/jbs/lessons/java/java_serialization/serverThreadedCO.html

,

0

Hessian: http://hessian.caucho.com/

We use Hessian to send serialized Java objects from our Java client to our servlet. Hessian can also be used in conjunction with the Spring framework .

0
source

All Articles