Results 1 to 2 of 2

Thread: JSP Query

  1. #1
    Join Date
    Apr 2006

    JSP Query

    I have an html page with a text field for the user to enter an ID the user can then click the button:

    <FORM METHOD=GET ACTION="find.jsp">
    <TD>Student ID:</TD>
    <TD><INPUT TYPE="text" NAME= "employeeID"></TD>
    <INPUT TYPE="submit" VALUE= "Display Employee">
    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?

    public String getSurname(String idEmployee)throws SQLException
            int employeeID;
            employeeID = Integer.parseInt(idEmployee);      
            Result result = getResult(link, employeeID);
            return result.getSurname();               }
    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:

    <%@ page language="java" contentType="text/html" 
    import="java.util.*" errorPage="errorSearch.jsp" %>
    <jsp:useBean id="surname" class="Employee.EmployeeRecords" />
    <jsp:setProperty name="surname" property="*" />
    <TITLE>Search an Employee</TITLE>
    <BODY bgcolor="blue">
    	<H1>Your Surname Result</H1>
       	<jsp:getProperty name="data" property="employeeID"/>
    any help would be appreciated, thanks.

  2. #2
    Join Date
    Apr 2006
    Its fine, ive sorted it, cheers ne way!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center