Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

applet communication with html form and servlet

 
rich werth
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I was recently told that an applet can communicate with an html form. For example it can take info from a user in and pass it to a servlet through the html form. Can anyone show me some code!!!
The applet (i'm guessing) would be embedded in the form tags?
<form>
<applet
codebase = "."
code = "applettest.first.class"
name = "TestApplet"
width = "400"
height = "300"
hspace = "0"
vspace = "0"
align = "middle"
>
</applet>
</form>
but the communication btwn the three things I'm lost. I have working servlets and beans (post/get)
 
Tim Holloway
Saloon Keeper
Posts: 18365
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The magic word is java.net.HttpURLConnection. That's how you send an HTTP request from within an applet and receive its reponse.
 
rich werth
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I do that. Say I have a database called animals.
the applet has a text field where a user can type in the animal that want to search. say dog.
the user presses submit on the applet it goes to the servlet does it's stuff in the back with the dataAccess beans and then a reply is sent to the same applet
yes dog is there!
can i see some code please.
 
Roy Ben Ami
Ranch Hand
Posts: 732
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey rich, check this link. it has exactly what u r looking for.
here
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic