Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

applet communication with html form and servlet

 
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)
 
Saloon Keeper
Posts: 22097
151
Android Eclipse IDE Tomcat Server Redhat Java 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.
 
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
 
Sometimes you feel like a nut. Sometimes you feel like a tiny ad.
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic