Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple send through socket  RSS feed

 
michael yue
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing a program to send some data to a server. It is in jsp and servlet based to enable user to use it through web. The problem is there is a checkbox page where when user click on a few check box and click a button the data associated with the button need to be sent like the delete function in any web based mail. How can i do this ? Now i an using sockets with thread to commumicate with the server.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd think that to call a servlet, you should just use a URL connection instead of raw sockets. That will look just like a browser to your server. It's a mild challenge to set up the headers and content to look like a form posted from a browser. But it would be a major challenge to implement the whole HTTP protocol in a raw socket!
Here's some code I'm using to simulate a browser. It fakes sending two forms - the logon userid & password and the shutdown button. It works most of the time but there may be opportunities for you to improve it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!