Question
How do I convert this to jsp expression language (EL)? Wrox Shopping Mall Wrox JSTL Web Store ${curCat.name} Item Price Order ${curItem.name} BUY Wrox Shopping
How do I convert this to jsp expression language (EL)?
<%@page import="java.text.NumberFormat"%> <%@ page language="java" import = "cart.*,java.util.*" session="true" %>
<%! private static String EXAMPLE = "/myShoppingCart"; private static String SHOP_PAGE = "/estore.jsp"; private static String CART_PAGE = "/shopcart.jsp"; private static String CHECKOUT_PAGE = "/checkOut.jsp";
NumberFormat nf = NumberFormat.getCurrencyInstance(); %>
<%@include file="../includes/header.jsp" %> <% ArrayList items = (ArrayList) session.getAttribute("lineitems"); String action = request.getParameter("action"); String sku = request.getParameter("sku"); Product prod = null; if (sku != null) prod = EShop.getItem(sku);
if (items == null) { // add first item items = new ArrayList(); items.add(new LineItem(1,sku,prod.getName(), prod.getPrice() )); session.setAttribute("lineitems", items); } else if (action.equals("clear")) { items.clear(); } else if (action.equals("remove")) { for (int i = 0; i < items.size(); i++) { LineItem curItem = (LineItem) items.get(i); if (curItem.getQuantity() == 1) { items.remove(i); } else { curItem.setQuantity(curItem.getQuantity() - 1); } break; } } else { boolean itemFound = false; // check to see if sku exists for (int i=0; i LineItem curItem = (LineItem) items.get(i); if (curItem.getSku().equals(sku)) { itemFound = true; curItem.setQuantity(curItem.getQuantity() + 1); break; } // of if } //of for
if (!itemFound) items.add(new LineItem(1,sku,prod.getName(), prod.getPrice() )); } // of final else int total = 0; double tax = 0; double withTax = 0; %>
<%@include file="../includes/footer.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="wxshop" uri="EShopFunctionTagLibrary" %>
<%@ page session="true" %>
Wrox JSTL Web Store | |||||||
|
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="wxshop" uri="myShoppingCartTagLibrary" %>
<%@ page session="true" %>
VWCC JSTL Web Store | |||||||||||||||||||||||||||||||||||
|
<%-- Document : checkOut Created on : Feb 11, 2011, 1:27:24 PM Author : eroberts --%> <%@ page language="java" import = "cart.*,java.util.*" session="true" %> <% String message = (String) request.getAttribute("message"); String email = (String) request.getAttribute("email"); String password = (String) request.getAttribute("password");
if (email == null) { email = ""; } if (password == null) { password = ""; } if (message == null) { message=""; } %> <%@include file="../includes/header.jsp" %>
<%@include file="../includes/footer.jsp" %>
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started