开发者

Sending Java Beans From An Applet to A Servlet

I'm looking at sending a complex data type [a serialized java bean (strings, map, and an image)] from an applet to a Spring structured web application.

How would I send the bean? I'm assuming that I would create a URLConnection, and then send out a post with a serialized version of 开发者_如何学运维the bean.

How would I set up spring to catch this on the Server side? [Would I use a @RequestParam or @ModelAttribute]

Both the applet and the server have access to the model.


It depends on how you serialize it. If it is JSON, you can use @RequestBody, if it is binary (base64 string), it should be @RequestParam, and then you should deserialize it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜