This repository has been archived by the owner on Dec 31, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e60610
commit 6a7c090
Showing
24 changed files
with
257 additions
and
858 deletions.
There are no files selected for viewing
33 changes: 0 additions & 33 deletions
33
src/main/java/io/hardingadonis/miu/controller/admin/AdminServlet.java
This file was deleted.
Oops, something went wrong.
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
34 changes: 34 additions & 0 deletions
34
src/main/java/io/hardingadonis/miu/controller/admin/DashboardAdmin.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.hardingadonis.miu.controller.admin; | ||
|
||
import io.hardingadonis.miu.model.*; | ||
import java.io.*; | ||
import javax.servlet.*; | ||
import javax.servlet.annotation.*; | ||
import javax.servlet.http.*; | ||
|
||
@WebServlet(name = "DashboardAdmin", urlPatterns = {"/admin"}) | ||
public class DashboardAdmin extends HttpServlet { | ||
|
||
@Override | ||
protected void doGet(HttpServletRequest request, HttpServletResponse response) | ||
throws ServletException, IOException { | ||
request.setCharacterEncoding("UTF-8"); | ||
response.setContentType("text/html; charset=UTF-8"); | ||
|
||
HttpSession session = request.getSession(); | ||
|
||
Admin admin = (Admin) session.getAttribute("admin"); | ||
|
||
if (admin == null) { | ||
response.sendRedirect(request.getContextPath() + "/admin/login"); | ||
return; | ||
} | ||
|
||
request.getRequestDispatcher("/view/admin/dashboard-admin.jsp").forward(request, response); | ||
} | ||
|
||
@Override | ||
protected void doPost(HttpServletRequest request, HttpServletResponse response) | ||
throws ServletException, IOException { | ||
} | ||
} |
35 changes: 0 additions & 35 deletions
35
src/main/java/io/hardingadonis/miu/controller/admin/ListCategoryServlet.java
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
src/main/java/io/hardingadonis/miu/controller/admin/ListOrderServlet.java
This file was deleted.
Oops, something went wrong.
7 changes: 3 additions & 4 deletions
7
src/main/java/io/hardingadonis/miu/controller/admin/LoginAdmin.java
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
25 changes: 25 additions & 0 deletions
25
src/main/java/io/hardingadonis/miu/controller/admin/LogoutAdmin.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.hardingadonis.miu.controller.admin; | ||
|
||
import java.io.*; | ||
import javax.servlet.*; | ||
import javax.servlet.annotation.*; | ||
import javax.servlet.http.*; | ||
|
||
@WebServlet(name = "LogoutAdmin", urlPatterns = {"/admin/logout"}) | ||
public class LogoutAdmin extends HttpServlet { | ||
|
||
@Override | ||
protected void doGet(HttpServletRequest request, HttpServletResponse response) | ||
throws ServletException, IOException { | ||
request.setCharacterEncoding("UTF-8"); | ||
response.setContentType("text/html; charset=UTF-8"); | ||
|
||
HttpSession session = request.getSession(false); | ||
|
||
if (session != null) { | ||
session.invalidate(); | ||
} | ||
|
||
response.sendRedirect(request.getContextPath() + "/admin"); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/io/hardingadonis/miu/controller/admin/OrderAdmin.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package io.hardingadonis.miu.controller.admin; | ||
|
||
import io.hardingadonis.miu.model.*; | ||
import java.io.IOException; | ||
import javax.servlet.*; | ||
import javax.servlet.annotation.*; | ||
import javax.servlet.http.*; | ||
|
||
@WebServlet(name = "OrderAdmin", urlPatterns = {"/admin/order"}) | ||
public class OrderAdmin extends HttpServlet { | ||
|
||
@Override | ||
protected void doGet(HttpServletRequest request, HttpServletResponse response) | ||
throws ServletException, IOException { | ||
request.setCharacterEncoding("UTF-8"); | ||
response.setContentType("text/html; charset=UTF-8"); | ||
|
||
HttpSession session = request.getSession(); | ||
|
||
Admin admin = (Admin) session.getAttribute("admin"); | ||
|
||
if (admin == null) { | ||
response.sendRedirect(request.getContextPath() + "/admin/login"); | ||
return; | ||
} | ||
|
||
request.getRequestDispatcher("/view/admin/order-admin.jsp").forward(request, response); | ||
} | ||
|
||
@Override | ||
protected void doPost(HttpServletRequest request, HttpServletResponse response) | ||
throws ServletException, IOException { | ||
} | ||
|
||
} |
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
32 changes: 20 additions & 12 deletions
32
...miu/controller/admin/ListUserServlet.java → ...donis/miu/controller/admin/UserAdmin.java
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
Oops, something went wrong.