• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to send object from Applet to spring controller .

 
Kuladip Yadav
Ranch Hand
Posts: 162
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers ,

I want to send object from applet to spring servlet.
How should I can achieve this.
Any link appreciated .


Thank You

- Kuldeep Yadav
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using a Spring controller here is no different than sending information from an applet to any server-side component. The thing to remember is that the applet is running in the user's browser, on a different machine from the server. You could use regular distributed programming approaches, like sockets/RMI/WebServices/etc. but since you explicitly want to talk to a servlet, a better approach may be to just have the applet do a URLConnection back to the server and send the object as text content to the servlet (if your object can be serialized as text).
 
Kuladip Yadav
Ranch Hand
Posts: 162
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nathan,

the applet do a URLConnection back to the server and send the object as text content to the servlet


But how can I implement that , any reference ?

Thanks
- Kuldeep
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's a message with some URLConnection code on the servlet-interest mail archive. I'd also suggest possibly using Apache Commons HttpClient to wrap the more basic URLConnection.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!