Hi-- I don't know if i have just been staring at this too long but I am so frusterated i could cry....
I have an html form the user selects the type of sear(last name, first name, dept etc) and in a text box the user types in what are looking for then the user submits the page..
I have a class called EmployeeAddressSearchResultsServlet which displays the requested information in a table
The search is done against an access database
I don't know how to get the search to send the information and put it into the table. I do know that i am supose to loop and have the information feed in and create the table.
The instructor said to do it with a
servlet and a javabean...
can anybody point me in the right direction.
I have the basic structure of the pages
[code]
<html>
<head>
<title> Employee Address Book Search </title>
</head>
<body bgcolor = #33FFCC>
<h1 align = center> Search the Employee Address Book</h1>
<p>Employee Address Book:</p>
<p>To look an employee up by their last name </p>
<form action="/servlet/java146.project3.EmployeeAddressSearchResultsServlet" method="Get\">
<br /><input type="radio" name="empSearch" value="findListById">Employee Id
<br /><input type="radio" name="empSearch"value="findListByLastName">
Employee Last Name
<br /><input type="radio" name="empSearch"
value="findListByFirstName">Employee First Name
<br /><input type="radio" name="empSearch" value="findListByDept">Employee
Department Name
<br /><input type="text" name="search" SIZE="40" MAXLENGTH="40">
<br /><p align = center>
<input type = "submit" name = "submitButton" value = "Search">
<input type = "reset" name = "resetButton" value = "Reset">
/p>
<h4><a href =" ../index.html"> Back to Home Page</a></h4>
</form>
</body>
</html>
package java146.project3;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java146.util.*;
/**
* Description of the Class
*@author VBrandt
*@created November 24, 2004
*/
public class EmployeeAddressSearchResultsServlet extends HttpServlet
{
//Connection connects = null;
/**
* Description of the Method
*@exception ServletException Description of the Exception
*/
public void init() throws ServletException {}
/**
* Description of the Method
*@param req Description of the Parameter
*@param res Description of the Parameter
*@exception ServletException Description of the Exception
*@exception IOException Description of the Exception
*/
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
{
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.print("<html>");
out.print("<head>");
out.print("<title>Results Page</title>");
out.print("<h1 align = center>Search Results</h1>");
out.print("</head>");
out.print("<table border = 1 cellpadding = 2 align = center >");
out.print("<th>ID</th> <th>Last Name</th> <th>First
Name</th> <th>Department</th>");
out.print("<tr>");
out.print("<td> </td>");
out.print("<td> </td>");
out.print("<td> </td>");
out.print("<td> </td>");
out.print("</tr>");
out.print("</table>");
out.print("<p>");
out.print("<h4 align = center><a href =../index.html>
Back to Home Page</a>" +
"\t<a href =../EmpAddressPage.html> \t
Search again</h4></a>");
out.print("<BODY>");
out.print("</body>");
out.print("</html>");
}
}