• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet to Server(Urgent! Please help me)

 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have created simple example:which has textfields,Button.I want following>
Which method I can use to make connection to server when I click Button and how can I passed request of file(as string) to server.
Please help me out with very simple example.
Thanks a lot in advance,
Angela
 
Stephanie Grasson
Ranch Hand
Posts: 347
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Angela,
It is a little difficult to answer your question with the amount of information provided. There are several ways to connect to a server and pass information back and forth. However, I don't know of any that you can implement with just one method call.
One thing you could try is use sockets.
Here is a brief overview: http://java.sun.com/docs/books/tutorial/networking/sockets/index.html
and a simple example here: http://java.sun.com/docs/books/tutorial/networking/sockets/readingWriting.html
If this is not what you had in mind, let us know.
Hope this helps.
Stephanie
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stephanie Grasson
Thanks a lot for immediate reply.
Any method you think. I never used any method. If you give me an applet example in which i click on Button, i can get connection to server and request the file. Which method i have to use to make request to server..
Let me know
Thanks again
Angela
Originally posted by Angela Jessi:
Hi,
I have created simple example:which has textfields,Button.I want following>
Which method I can use to make connection to server when I click Button and how can I passed request of file(as string) to server.
Please help me out with very simple example.
Thanks a lot in advance,
Angela

 
Stephanie Grasson
Ranch Hand
Posts: 347
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Angela,
Here is an example of an applet with a TextArea and a Button. The user can enter the url of the file on the server that want to access in the TextArea. When they click the button, the applet will try to go there:

Is this what you meant? I was not sure. Please let us know.
Stephanie
 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stephanie Grasson,
I really appreciate your response.
I am sorry I didn't explain properly.
Let me write down my need.
I have server with socket number 8080.I want to write one code in way (Applet), that client make connection to server port 8080 and can request any HTML file from server.
So do we need to use GET and POST or other methods.
Please let know by applet example
Thanks again,
Regds,
Angela
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic