]> git.mxchange.org Git - pizzaservice-war.git/blobdiff - web/form_handler/admin/do_category.jsp
Fixed more packages
[pizzaservice-war.git] / web / form_handler / admin / do_category.jsp
index ddd04d64f8e23596b04007340ebb401f78e8e785..656e336cc6f4b3fef1680d54cca0a015cb1797b5 100644 (file)
@@ -6,62 +6,36 @@
 
 <%--<%@page errorPage="errorHandler.jsp" %>--%>
 <%@page contentType="text/html" pageEncoding="UTF-8"%>
-<%@page import="org.mxchange.pizzaapplication.application.PizzaServiceApplication"%>
-<%@page import="org.mxchange.pizzaapplication.application.PizzaApplication"%>
-<%@page import="org.mxchange.pizzaapplication.beans.CustomerBean" %>
+<%@page import="org.mxchange.pizzaapplication.beans.controller.PizzaServiceBean"%>
+<%@page import="org.mxchange.pizzaapplication.beans.PizzaBean"%>
+<%@page import="org.mxchange.pizzaapplication.beans.customer.CustomerBean" %>
 <%@page import="org.mxchange.pizzaapplication.product.Product"%>
 <%@page import="org.mxchange.pizzaapplication.exceptions.CategoryTitleAlreadyUsedException"%>
+<jsp:useBean id="controller" scope="session" class="org.mxchange.pizzaapplication.beans.controller.PizzaServiceBean" type="org.mxchange.pizzaapplication.beans.PizzaBean" />
 
-<%
-       // Init application instance
-       PizzaApplication app = PizzaServiceApplication.getInstance(application);
-
-       // Is it post?
-       if ("POST".equals(request.getMethod())) { //NOI18N
-               // Is "add/edit/delete" set?
-               if (request.getParameter("add") != null) { //NOI18N
-                       // Add new category
-                       try {
-                               app.doAdminAddCategory(request);
-                       } catch (final CategoryTitleAlreadyUsedException e) {
-                               // Already used!
-                               response.sendRedirect(request.getContextPath() + "/admin/category.jsp?already=1"); //NOI18N
-                       }
-               } else if (request.getParameter("edit") != null) { //NOI18N
-                       // @TODO
-               } else if (request.getParameter("delete") != null) { //NOI18N
-                       // @TODO
-               }
+<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<c:set var="basePath" value="${pageContext.request.contextPath}" />
 
-               // Redirect to proper URL
-               // @TODO Commented out for developing:
-               //response.sendRedirect(request.getContextPath() + "/finished.jsp");
-       }
+<%
+       // Handle forms
+       controller.doAdminHandleCategoryForms(request, response);
 %>
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
        <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-               <link rel="stylesheet" href="<%=request.getContextPath()%>/style.css" type="text/css"/>
-               <title><%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler</title>
+               <link rel="stylesheet" href="${basePath}/style.css" type="text/css"/>
+               <title>Pizza-Service - Form-Handler</title>
        </head>
 
        <body>
                <div id="title">
-                       <h1><%=PizzaServiceApplication.MAIN_TITLE%> - Form-Handler</h1>
+                       <h1>Pizza-Service - Form-Handler</h1>
                </div>
 
-               <jsp:include page="/static/admin/menu.jsp" flush="true" />
+               <jsp:include page="/static/admin/admin_menu.jsp" flush="false" />
 
-               <div id="content_outer">
-                       <div id="content_title">
-                               <h2>Bitte nicht direkt aufrufen:</h2>
-                       </div>
-
-                       <div id="content">
-                               Bitte rufen Sie diese Seite nicht direkt auf.
-                       </div>
-               </div>
+               <jsp:include page="/static/error/direct_call.jsp" flush="false" />
        </body>
 </html>