Our Bookshelf contains this title:
-Author: ${book.getAuthor()}
- +Our Bookshelf contains following titles:
+ <% for (Book book : (ListAuthor: <%= book.getAuthor() %>
+ + <% } %> + <%@ include file="shopping-cart-hint.jsp"%> + <%@ include file="visitor-counter.jsp"%> diff --git a/patterns/src/main/webapp/WEB-INF/jsp/book-notfound.jsp b/patterns/src/main/webapp/WEB-INF/jsp/book-notfound.jsp index 2f8ac01755..284b1e4759 100644 --- a/patterns/src/main/webapp/WEB-INF/jsp/book-notfound.jsp +++ b/patterns/src/main/webapp/WEB-INF/jsp/book-notfound.jsp @@ -1,10 +1,11 @@ - -Our Bookshelf doesn't contains this title:
-<%= book.getAuthor() %>:
+Please input a username:
++ Your shopping cart is holding + <% if (order.getItems().size() == 1) { %> + 1 item. + <% } else { %> + <%= (order.getItems().size()) %> items. + <% } %> + Checkout +
+ <% } %> +<% } %> diff --git a/patterns/src/main/webapp/WEB-INF/jsp/shopping-cart.jsp b/patterns/src/main/webapp/WEB-INF/jsp/shopping-cart.jsp new file mode 100644 index 0000000000..024a3bac3e --- /dev/null +++ b/patterns/src/main/webapp/WEB-INF/jsp/shopping-cart.jsp @@ -0,0 +1,29 @@ +<%@ page import="com.baeldung.patterns.data.Book" %> +<%@ page import="com.baeldung.patterns.data.Order" %> +<%@ page import="java.util.Map" %> + + + +You are about to buy the following books:
++ Total: <%= request.getAttribute("total") %> +
+ + + diff --git a/patterns/src/main/webapp/WEB-INF/jsp/visitor-counter.jsp b/patterns/src/main/webapp/WEB-INF/jsp/visitor-counter.jsp new file mode 100644 index 0000000000..397364e2b3 --- /dev/null +++ b/patterns/src/main/webapp/WEB-INF/jsp/visitor-counter.jsp @@ -0,0 +1,5 @@ +<% Integer counter = (Integer) request.getAttribute("counter"); %> +<% if (counter != null && counter > 0) { %> +You are visitor #<%= counter %>. Logout
+<% } %> diff --git a/patterns/src/main/webapp/WEB-INF/web.xml b/patterns/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 77113db09b..0000000000 --- a/patterns/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,15 +0,0 @@ - -