db1.jsp
============================================================
<%@page import="kr.co.seoulit.emp.to.EmpBean"%>
<%@page import="java.util.List"%>
<%@page import="kr.co.seoulit.emp.dao.EmpDAOImpl"%>
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
<style type="text/css">
td {border:3px solid navy; }
</style>
</head>
<body><table>
<%
List<EmpBean> list=EmpDAOImpl.getInstance().selectEmpList();
for(EmpBean bean:list){
out.println("<tr>");
out.println("<td>"+"<a href=db2.jsp?id="+bean.getEname()+">"+bean.getEname()+"</td>");
out.println("</tr>");
}
%>
</table></body>
</html>
db2.jsp
==================================================================
<%@page import="kr.co.seoulit.emp.to.EmpBean"%>
<%@page import="java.util.List"%>
<%@page import="kr.co.seoulit.emp.dao.EmpDAOImpl"%>
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
<style type="text/css">
td {border:3px solid navy; }
</style>
</head>
<body><table>
<%
EmpBean bean=EmpDAOImpl.getInstance().selectEmp(request.getParameter("id"));
if(bean!=null){
out.println("<tr>");
out.println("<td>"+bean.getEmpno()+"</td>");
out.println("<td>"+bean.getJob()+"</td>");
out.println("<td>"+bean.getMgr()+"</td>");
out.println("<td>"+bean.getHiredate()+"</td>");
out.println("<td>"+bean.getLoc()+"</td>");
out.println("</tr>");
}
%>
</table></body>
</html>
'개발하자 > JSP&Servlet' 카테고리의 다른 글
서블릿 한글값 넘기기 (0) | 2015.03.05 |
---|---|
Servlet doget호출하여 doget에서 dopost호출 (0) | 2015.03.05 |
한폼에 submit버튼 두개일 때 이동페이지 설정 (0) | 2015.03.01 |
member테이블 불러와서 내용 수정과 삭제하기 (0) | 2015.03.01 |
emp테이블의 ename 출력하고 클릭하면 상세정보 나옴(dept테이블 조인) (0) | 2015.02.25 |