0% found this document useful (0 votes)
2 views

Untitledt

This document is a JSP page for managing employee records, allowing users to add new employees and view a list of existing ones. It includes a form for inputting employee details such as ID, name, designation, and salary, and displays the employee list in a table format with options to update or delete records. The page interacts with an EmployeeDao class to handle data operations and provides feedback messages upon submission.

Uploaded by

nilimapawase14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Untitledt

This document is a JSP page for managing employee records, allowing users to add new employees and view a list of existing ones. It includes a form for inputting employee details such as ID, name, designation, and salary, and displays the employee list in a table format with options to update or delete records. The page interacts with an EmployeeDao class to handle data operations and provides feedback messages upon submission.

Uploaded by

nilimapawase14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

<%@page contentType="text/html" pageEncoding="UTF-8"

import="model.Employee,dao.EmployeeDao,java.util.*"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
EmployeeDao edao=new EmployeeDao();
List<Employee>lst=edao.GetAllEmployees();
%>
<h1>Employee!!!</h1>
<form method="post">
<table>
<tr>
<td>Employee Id</td>
<td><input type="text" name="txtid"/></td>
</tr>
<tr>
<td>Employee Name</td>
<td><input type="text" name="txtname"/></td>
</tr>
<tr>
<td>Designation</td>
<td><input type="text" name="txtdesignation"/></td>
</tr>
<tr>
<td>Salary</td>
<td><input type="text" name="txtsalary"/></td>
</tr>
<tr>
<td><input type="submit" value="Submit"/></td>
</tr>
</table>
</form>
<%
String msg="";
if(request.getMethod().equals("POST"))
{
int id=Integer.parseInt(request.getParameter("txtid"));
String name=request.getParameter("txtname");
String des=request.getParameter("txtdesignation");
float sal=Float.parseFloat(request.getParameter("txtsalary"));

Employee emp=new Employee(id, name, des, sal);


msg=edao.AddEmployee(emp);
lst=edao.GetAllEmployees();
}
%>
<h4><%=msg %></h4>
<hr/>
<table border="1">
<thead>
<tr>
<th>Employee Id</th>
<th>Employee Name</th>
<th>Designation</th>
<th>Salary</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<%
for(Employee e:lst)
{
%>
<tr>
<td><%=e.getEmployee_id() %></td>
<td><%=e.getEmployee_name() %></td>
<td><%=e.getDesignation() %></td>
<td><%=e.getSalary() %></td>
<td>
<a href="UpdateEmployee.jsp?employee_id=<
%=e.getEmployee_id() %>">update</a>
<a href="DeleteEmployee.jsp?employee_id=<
%=e.getEmployee_id() %>">Delete</a>
</td>
</tr>
<%
}
%>
</tbody>
</table>
</body>
</html>

You might also like