Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

a jsp page for searching employees

843836Feb 17 2005 — edited Feb 24 2005
this jsp page is used for searching employees and displaying the search results.
when the submit button is clicked, the http request will be sent to a servlet java class.

<%@ page contentType="text/html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

<html>

<head>

<title>SEARCH STAFF</title>
</head>

<body>
<p align="center"><font color="#008000">SEARCH STAFF</font></p>

<FORM METHOD=POST ACTION="/servlet/ReqHandler?action=searchstaffget">


<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
    <tr>
    <td width="50%">Staff ID:</td>
    <td width="50%"><INPUT NAME=staffid SIZE=15></td>
  </tr>
  <tr>
    <td width="50%">First Name:</td>
    <td width="50%"><INPUT NAME=firstname SIZE=30></td>
  </tr>
    <tr>
    <td width="50%">Last Name:</td>
    <td width="50%"><INPUT NAME=lastname SIZE=30></td>
  </tr>
  <tr>
    <td width="50%">Gender:</td>
    <td width="50%"><select size="1" name="sex">
    <option value="m" selected>Male</option>
    <option value="f">Female</option>
    </select></td>
  </tr>
   <tr>
    <td width="50%">E-mail:</td>
    <td width="50%"><INPUT NAME=email SIZE=30></td>
  </tr>

  <tr>
    <td width="50%">Birth date:</td>
    <td width="50%"><INPUT NAME=birthdate SIZE=10></td>
  </tr>
  <tr>
    <td width="50%">Address:</td>
    <td width="50%"><input type="text" name="addr" size="30"></td>
  </tr>
  <tr>
    <td width="50%">Phone number (Home):</td>
    <td width="50%">
<input type="text" name="phoneno" size="8"></td>
  </tr>
  <tr>
    <td width="50%">Phone number (Mobile):</td>
    <td width="50%">
   <input type="text" name="mobileno" size="8"></td>
  </tr>
  <tr>
    <td width="50%">ID card number:</td>
    <td width="50%"><input type="text" name="idno" size="8"></td>
  </tr>
    <tr>
      <td width="50%">Position:</td>
      <td width="50%"><select size="1" name="position">
    <option value="deliveryman" selected>Deliveryman</option>
    <option value="normalstf">Normal Staff</option>
    </select></td>
  </tr>
      
  
</table>

<P align="center">
<INPUT TYPE=SUBMIT></FORM>


<!--

I WANT THE SEARCH RESULTS TO BE DISPLAYED HERE IN THIS JSP PAGE.
THIS MEANS THAT, AFTER THE SUBMIT BUTTON IS CLICKED, THE FORM ABOVE WILL NOT DISAPPEAR AND THE SEARCH RESULTS WILL DISPLAY BELOW THE FORM.

 --> 
the java servlet class will then forward the search parameters(last name, first name....etc.) to a database accessor class and this class will then return an arraylist of all the columns for each row in the database that match the search criteria. Each column of a row is stored as a String object in the arraylist.

what i would like to ask is, what codes should i use in the servlet class, and what codes should i use in the jsp page, in order that, the search results will finally display in <TABLE> format.

please help, thanks a lot~~~~~~~~
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2005
Added on Feb 17 2005
5 comments
228 views