Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

a newbie in need of urgent help

 
john mattucci
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to design an Applet which will be placed in
a Lotus Notes email. This Applet is quite basic it will need to obtain employee info eg. name, phone# ect. At most a dozen fields. The email would then be sent to all employees and in turn when they would compile the form all info would be saved on SQL.
Im new to Servlets and Applets. My question in the end is this how would I "Post" this information to the Servlet to than pass to SQL. I know that I can extend the GenericServlet class but that class does not provide methods like the HttpServlet class such as doGet and doPost, for handling HTTP-specific services. Am i approaching this correctly? I really need to solve this. Thank you all for your time.
 
Ming Chen
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The idea is you get user's entries through applet which provides html parameters. The parameters are then sent to servlet, the servlet can setup connection to database, insert user data to db. You can also let the servlet send email to anyone.
This is not so hard to implement. If you want servlet to send email, you need add a java mail server package downloadable from SUN.
For DB, you can use javabean or setup your own connection in servlet.
Good luck.
Ming
 
Sunny Liu
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi John
In your applet you open URLConnection to servlet then post data to servlet.
Your servlet extends HttpServlet, then you can overwrite doPost() or doGet() method to process request. use JDBC in your servlet and post data to Database.
 
john mattucci
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It was my understanding that the doPost() method replies to POST requests from within an HTML document. My Applet is not sitting within an HTML document, it will be pasted within an email. So can I still do what you suggest. Thanks again for your time.
 
john mattucci
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry im also having a hard time understanding how parameters will be passed to doPost(). Eg.
I enter my name John Mattucci how will this information be passed from the Applet to the Servlet. Thank you all
 
Ming Chen
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use add a send button on your applet to trigger and open URLConnection to servlet then then send parameters to servlet, it's exactly the same as you send parameters from html form. Please study documentation of java.applet.Applet and the related class to find those useful methods.
Ming Chen
SCJP2
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic