
February 13th, 2001, 09:38 PM
|
|
Contributing User
|
|
Join Date: Feb 2001
Location: Colorado
Posts: 46
Time spent in forums: < 1 sec
Reputation Power: 13
|
|
In order to get variables from your HTML form in your servlet you need to access the HTTPRequest object in your doGet or doPost method. I am assuming that you have some code like this:
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException{...}
In order to get the values that were entered into the form you need to use code like this in your doGet or doPost method:
String phone = req.getParameter("phoneNumber");
You will probably have different parameters, but you will just need to enter their names where I have used "phoneNumber". The name you pass to the getParameter() method needs to be the name you gave the field in your HTML form.
A good tutorial can be found at:
http://developer.java.sun.com/devel...troduction.html
I hope that helps.
__________________
- MW
|