Commit ac6016de authored by Fabian Dewantara Santonie's avatar Fabian Dewantara Santonie 🕊

Memberikan halaman tampilan data

parent f8fc182d
......@@ -23,34 +23,80 @@ public class DataDiri extends HttpServlet {
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
* response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// TODO Auto-generated method stub
response.getWriter().append("Served at: ").append(request.getContextPath());
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
* response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// TODO Auto-generated method stub
String namaLengkap = request.getParameter("namaLengkap");
String namaPanggilan = request.getParameter("namaPanggilan");
String tempatLahir = request.getParameter("tempatLahir");
String tanggalLahir = request.getParameter("tanggalLahir");
String jenisKelamin = request.getParameter("jenisKelamin");
String hobi = request.getParameter("hobi");
String hobiBerenang = request.getParameter("hobiBerenang");
String hobiFutsal = request.getParameter("hobiFutsal");
String hobiBuku = request.getParameter("hobiBuku");
String hobiBadminton = request.getParameter("hobiBadminton");
String hobiLainnya = request.getParameter("hobiLainnya");
String email = request.getParameter("email");
String anak = request.getParameter("anak");
String pendidikan = request.getParameter("pendidikan");
String alamat = request.getParameter("alamat");
String username = request.getParameter("username");
request.setAttribute("username", username);
request.setAttribute("namaLengkap", namaLengkap);
request.setAttribute("namaPanggilan",namaPanggilan);
request.setAttribute("namaPanggilan", namaPanggilan);
request.setAttribute("tempatLahir", tempatLahir);
request.setAttribute("tanggalLahir", tanggalLahir);
request.setAttribute("jenisKelamin", jenisKelamin);
String hobi = "";
try {
if (hobiBerenang.equals("Berenang")) {
hobi = hobi + hobiBerenang +" ,";
}
}
catch (Exception e) {
}
try {
if (hobiBuku.equals("Membaca_Buku")) {
hobi = hobi + hobiBuku +" ";
}
}
catch (Exception e) {
}
try {
if (hobiFutsal.equals("Futsal")) {
hobi = hobi + hobiFutsal +" ";
}
}
catch (Exception e) {
}
try {
if (hobiBadminton.equals("Badminton")) {
hobi = hobi + hobiBadminton +" ";
}
}
catch (Exception e) {
}
try {
if (hobiLainnya.equals("Lainnya")) {
hobi = hobi + hobiLainnya +" ";
}
}
catch (Exception e) {
}
request.setAttribute("hobi", hobi);
request.setAttribute("email", email);
request.setAttribute("anak", anak);
......
......@@ -37,7 +37,7 @@
<td>Hobi</td>
<td>
<input type="checkbox" id="hobiBerenang" name="hobiBerenang" value="Berenang"><label for="hobiBerenang">Berenang</label>
<input type="checkbox" id="hobiBuku" name="hobiBuku" value="Membaca Buku"><label for="hobiBuku">MembacaBuku</label>
<input type="checkbox" id="hobiBuku" name="hobiBuku" value="Membaca_Buku"><label for="hobiBuku">MembacaBuku</label>
<input type="checkbox" id="hobiFutsal" name="hobiFutsal" value="Futsal"><label for="hobiFutsal">Futsal</label>
<input type="checkbox" id="hobiBadminton" name="hobiBadminton" value="Badminton"><label for="hobiBadminton">Badminton</label>
<input type="checkbox" id="hobiLainnya" name="hobiLainnya" value="Lainnya"><label for="hobiLainnya">Lainnya</label>
......
......@@ -7,6 +7,7 @@
<title>Insert title here</title>
</head>
<body>
<b>Selamat Datang ${username}</b>
<table border="2">
<tr>
<th>Nama Lengkap</th>
......@@ -26,7 +27,7 @@
<th>${tempatLahir}</th>
<th>${tanggalLahir}</th>
<th>${jenisKelamin}</th>
<th>${Hobi}</th>
<th>${hobi}</th>
<th>${email}</th>
<th>${anak}</th>
<th>${pendidikan}</th>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment