www.webdeveloper.com
Results 1 to 2 of 2

Thread: JSP Query

  1. #1
    Join Date
    Apr 2006
    Posts
    24

    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:

    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>
    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:
    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:

    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"/>
    any help would be appreciated, thanks.

  2. #2
    Join Date
    Apr 2006
    Posts
    24
    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



Recent Articles