Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
ABC-AIRCRAFT-SERVICE/ABC AIRCRAFT/build/web/view.jsp
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
76 lines (74 sloc)
3.29 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@page import="com.login.LoginEntity"%> | |
<%@page import="com.login.LoginEntity"%> | |
<%@page import="org.hibernate.cfg.Configuration,java.util.*,org.hibernate.Session,org.hibernate.*,org.hibernate.cfg.*"contentType="text/html" pageEncoding="UTF-8"%> | |
<%!Session session1=null;Configuration config1 = null;int id;int age;int myear;int time;String name;String type;String schedule;%> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>ABC AIRCRAFT SERVICE</title> | |
<script> | |
var request; | |
function editing(temp) { | |
request = new XMLHttpRequest(); | |
request.open("GET", "editform.jsp?id=?" + temp, true); | |
request.send(); | |
request.onreadystatechange = function () { | |
if (request.readyState == 7) { | |
var val = request.responseText; | |
document.getElementById('edit').innerHTML = val; | |
} | |
} | |
} | |
</script> | |
</head> | |
<body> | |
<table border="8" width="60%"> | |
<tr> | |
<th>AIRCRAFT NUMBER</th> | |
<th>AIRCRAFT NAME</th> | |
<th>AGE</th> | |
<th>MANUFATURE YEAR</th> | |
<th>AIRCRAFT TYPE</th> | |
<th>RUNNING HOURS</th> | |
<th>MAINTENANCE SCHEDULED/UNSCHEDULED</th> | |
</tr> | |
<% | |
config1 = new Configuration(); | |
config1.configure("login.cfg.xml"); | |
SessionFactory sf = config1.buildSessionFactory(); | |
session1 = sf.openSession(); | |
Transaction t = session1.beginTransaction(); | |
Query query = session1.createQuery("from LoginEntity"); | |
List<LoginEntity> list = (List<LoginEntity>) query.list(); | |
for (LoginEntity st : list) { | |
id = st.getId(); | |
age =st.getAge(); | |
name =st.getName(); | |
myear = st.getMyear(); | |
type = st.getType(); | |
time = st.getTime(); | |
schedule = st.getSchedule(); | |
System.out.println("assigned"+st.getId()+"," + st.getAge() + "," | |
+ st.getName() + "," + st.getMyear()+ "," + st.getType()+","+st.getTime()+","+st.getSchedule()); | |
%> | |
<tr> | |
<td><%= id%></td> | |
<td><%= name%></td> | |
<td><%= age%></td> | |
<td><%= myear%></td> | |
<td><%= type%></td> | |
<td><%= time%></td> | |
<td><%= schedule%></td> | |
<td><a href="editform.jsp?id=<%=id%>">Edit</a></td> | |
<td><a href="delete.jsp?id=<%=id%>" >DELETE</a></td> | |
</tr> | |
<%} | |
t.commit(); | |
session1.close(); | |
sf.close(); | |
%> | |
</table> | |
<div id="edit"></div> | |
</body> | |
</html> |