I have an html page with a text field for the user to enter an ID the user can then click the button:
I then have a java page in a bean which works using a GUI because I have already done this, so I think it needs tweaking and I'm not sure if it needs a set method or not, there is already a database connection and other methods that get the correct information from the database, but the java that is necassary to understand what I'm doing is: can anyone help with what else i need for the jsp to work?Code:<FORM METHOD=GET ACTION="find.jsp"> <TABLE> <TR> <TD>Student ID:</TD> <TD><INPUT TYPE="text" NAME= "employeeID"></TD> </TR> </TABLE> <BR><BR> <INPUT TYPE="submit" VALUE= "Display Employee"> </FORM>
and then the jsp code which i want to be able to show the employees surname from the database after the initial id entry from the user:Code:public String getSurname(String idEmployee)throws SQLException { int employeeID; employeeID = Integer.parseInt(idEmployee); Result result = getResult(link, employeeID); return result.getSurname(); }
any help would be appreciated, thanks.Code:<HTML> <%@ page language="java" contentType="text/html" import="java.util.*" errorPage="errorSearch.jsp" %> <jsp:useBean id="surname" class="Employee.EmployeeRecords" /> <jsp:setProperty name="surname" property="*" /> <HEAD> <TITLE>Search an Employee</TITLE> </HEAD> <BODY bgcolor="blue"> <CENTER> <H1>Your Surname Result</H1> <BR><BR><BR> <jsp:getProperty name="data" property="employeeID"/>


Reply With Quote
Bookmarks