<%-- 프로그램 명 : 회원정보 화면표시 프로그램 : memberList_GUI.jsp
개발자 : Alex Ryu
개발 시작일 : 2026년 5월 14일
프로그램 Version UpGrade 2026년 5월 17일
추가 개발수정 부분 : 저장된 회원정보 GUI 표시프로그램
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="java.io.*" %>
<!DOCTYPE html>
<html>
<head>
<title>회원 목록 (GUI 스타일)</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f9f9f9;
text-align: center;
}
h2 {
color: #333;
}
.container {
width: 700px;
margin: 30px auto;
background: #fff;
border: 1px solid #ccc;
border-radius: 8px;
padding: 20px;
box-shadow: 0 0 10px #aaa;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 15px;
}
th, td {
border: 1px solid #ddd;
padding: 10px;
}
th {
background-color: #4CAF50;
color: white;
}
tr:nth-child(even) { background-color: #f2f2f2; }
tr:hover { background-color: #ddd; }
.btn {
display: inline-block;
margin-top: 20px;
padding: 10px 20px;
background: #4CAF50;
color: white;
text-decoration: none;
border-radius: 5px;
}
.btn:hover {
background: #45a049;
}
</style>
</head>
<body>
<div class="container">
<h2>회원 목록</h2>
<table>
<tr>
<th>아이디</th>
<th>비밀번호</th>
<th>이름</th>
<th>이메일</th>
</tr>
<%
String filePath = application.getRealPath("/members.txt");
try {
BufferedReader br = new BufferedReader(new FileReader(filePath));
String line;
while ((line = br.readLine()) != null) {
String[] data = line.split(",");
if (data.length == 4) {
%>
<tr>
<td><%= data[0] %></td>
<td><%= data[1] %></td>
<td><%= data[2] %></td>
<td><%= data[3] %></td>
</tr>
<%
}
}
br.close();
} catch(Exception e) {
out.println("<p>회원 정보를 불러오는 중 오류 발생: " + e.getMessage() + "</p>");
}
%>
</table>
<a href="register.jsp" class="btn">회원가입 페이지로 이동</a>
</div>
</body>
</html>