Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic