]> git.mxchange.org Git - pizzaservice-war.git/commitdiff
Again lesser scriptlets + added initialization of controller bean
authorRoland Haeder <roland@mxchange.org>
Fri, 28 Aug 2015 09:24:10 +0000 (11:24 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 28 Aug 2015 09:24:10 +0000 (11:24 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/java/org/mxchange/pizzaapplication/application/PizzaServiceApplication.java
src/java/org/mxchange/pizzaapplication/category/BaseCategory.java
src/java/org/mxchange/pizzaapplication/category/Category.java
web/admin/category.jsp
web/admin/product.jsp
web/static/admin/admin_category_selection_box.jsp
web/static/admin/admin_parent_category_selection_box.jsp

index ff05279f08b30543367e76868062bb17e36e0a50..eb222f5f69dc6c57bb15add2d0632b7d6b6903ea 100644 (file)
@@ -1370,7 +1370,7 @@ public class PizzaServiceApplication extends BasePizzaServiceSystem implements P
                String title = null;
                try {
                        // Now get title from it and return it
-                       title = category.decodedTitle();
+                       title = category.getDecodedTitle();
                } catch (final UnsupportedEncodingException ex) {
                        // Continue to throw as cause
                        throw new ServletException(ex);
index 208cfb680a1d425c0088ff0a6c5d2ec20e34788e..89978d6d3857e108f642a8ddd4fabc3bcc6f31f2 100644 (file)
@@ -100,7 +100,7 @@ public class BaseCategory extends BaseFrameworkSystem implements Category {
         * @return Decoded title
         */
        @Override
-       public final String decodedTitle () throws UnsupportedEncodingException {
+       public final String getDecodedTitle () throws UnsupportedEncodingException {
                // Get title
                byte[] t = this.getTitle().getBytes();
                
index a4cfc3184f0bcbd61de86aacc70ce7311af70ee3..c7248f534c46e91029670b00305b6769a88f5564 100644 (file)
@@ -76,5 +76,5 @@ public interface Category extends Storeable, Comparable<Category> {
         * @return Decoded title
         * @throws java.io.UnsupportedEncodingException If the encoding UTF-8 is not supported
         */
-       public String decodedTitle () throws UnsupportedEncodingException ;
+       public String getDecodedTitle () throws UnsupportedEncodingException ;
 }
index 3742aa13d77845552a4a236b6e2a0be9bbba99c9..b9a0bd40d1d36e7560a3e812541591740fdbf3c1 100644 (file)
 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <jsp:useBean id="controller" scope="session" class="org.mxchange.pizzaapplication.beans.PizzaServiceBean" type="org.mxchange.pizzaapplication.beans.PizzaBean" />
 
+<jsp:setProperty name="controller" property="application" value="${pageContext.servletContext}" />
+<jsp:setProperty name="controller" property="basket" value="${basket}" />
+<%controller.init();%>
+
 <!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"/>
+               <link rel="stylesheet" href="${basePath}/style.css" type="text/css"/>
                <title>Pizza-Service - Kategorien</title>
        </head>
 
@@ -37,7 +41,7 @@
 
                        <div id="content">
                                <div class="para">
-                                       <form action="<%=request.getContextPath()%>/form_handler/admin/do_category.jsp" accept-charset="utf-8" id="form" method="post">
+                                       <form action="${basePath}/form_handler/admin/do_category.jsp" accept-charset="utf-8" id="form" method="post">
                                        <table class="table">
                                                <thead>
                                                        <tr>
                                                </thead>
 
                                                <tbody>
-                                                       <c:forEach var="category" items="<%=controller.getCategories()%>">
+                                                       <c:forEach var="category" items="${controller.categories}">
                                                        <tr>
                                                                <td>
                                                                        <input class="input" type="checkbox" name="<%=CategoryFrontend.COLUMN_ID%>[${category.getCategoryId()}]" value="1" />
                                                                </td>
                                                                <td>
-                                                                       ${category.decodedTitle()}
+                                                                       ${category.decodedTitle}
                                                                </td>
                                                                <td>
                                                                        ${app.generateLinkForParent(category)}
@@ -81,7 +85,7 @@
                                </div>
 
                                <div class="para">
-                                       <form action="<%=request.getContextPath()%>/form_handler/admin/do_category.jsp" accept-charset="utf-8" id="add" method="post">
+                                       <form action="${basePath}/form_handler/admin/do_category.jsp" accept-charset="utf-8" id="add" method="post">
                                        <div class="table">
                                                <div class="table_header">
                                                        Neue Kategorie hinzufügen:
index 09b79b4ed1f96fa85b5b600c2b345cd9f79e2d68..c8192815957688431634b348535b10cd67c5b481 100644 (file)
@@ -16,6 +16,9 @@
 <%@page import="org.mxchange.pizzaapplication.database.frontend.product.ProductFrontend"%>
 <jsp:useBean id="controller" scope="session" class="org.mxchange.pizzaapplication.beans.PizzaServiceBean" type="org.mxchange.pizzaapplication.beans.PizzaBean" />
 
+<jsp:setProperty name="controller" property="application" value="${pageContext.servletContext}" />
+<%controller.init();%>
+
 <c:set var="basePath" value="${pageContext.request.contextPath}" />
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
index 52a0d335a4d7001716c2db7702ea7a97ab9e32fc..a125fd69aef2536978f6302e857c72b19e02556e 100644 (file)
@@ -12,6 +12,6 @@
 
 <select class="select" name="<%=CategoryFrontend.COLUMN_ID%>" size="1">
        <c:forEach var="category" items="${controller.categories}">
-               <option value="${category.getCategoryId()}">${category.decodedTitle()}</option>
+               <option value="${category.getCategoryId()}">${category.getDecodedTitle()}</option>
        </c:forEach>
 </select>
index 7d118ec97bcac2e054f9699bae58920c25b79bc5..7dae1c089bbf6b12b1809b76ff9c6038e32dbd7e 100644 (file)
@@ -13,6 +13,6 @@
 <select class="select" name="<%=CategoryFrontend.COLUMN_PARENT%>" size="1">
        <option value="">Ist oberste Kategorie</option>
        <c:forEach var="category" items="${controller.categories}">
-               <option value="${category.getCategoryId()}">${category.decodedTitle()}</option>
+               <option value="${category.getCategoryId()}">${category.getDecodedTitle()}</option>
        </c:forEach>
 </select>