How to query database through button click event from JSP
Hi all,
I can retrieve the values from DB and print them onto a JSP. However, I can't do the reverse process- that's queries DB through a button click event from a JSP. Here is my sample code. I am using struts framework. I tried to execute the code after minimizing errors and all I could get is form bean null exception.
<tr>
<td colspan="2">
<table width="100%" border="0" class="tdbgdark">
<tr>
<td colspan="2">Add Employee</td>
<td colspan="20"> </td>
</tr>
<tr>
<td>Employee Number</td>
<td><label> <input name="employeeNumber" type="text" id="employeeNumber" maxlength="10" /> </label></td>
<td><label>or Employee Name</label></td>
<td colspan="5"><label> <input name="name" type="text" id="name" maxlength="50" /> </label></td>
</tr>
<tr class="tdbgdark">
<html:button property="button" value="Get Employee" />
/* AFTER THE USER CLICKS ON THIS BUTTON- DB NEEDS TO BE QUERIED */
</tr>
<tr>
<td align="center" colspan="4">// HERE RESULTS ARE DISPLAYED</td>
</tr>
<tr class="tdbgdark">
<td colspan="4" align="center">Highlight one employee from the list above</td>
</tr>
Thanks and Regards,

