showprice.jsp
来自「网络商店源代码用NetBeans6.1Beta开发」· JSP 代码 · 共 55 行
JSP
55 行
<%@page contentType="text/html" pageEncoding="UTF-8"%><%@page import="model.*"%><%@page import="java.util.*"%><%@page import="org.apache.commons.lang.StringEscapeUtils" %><jsp:useBean id="pb" scope="session" class="model.ProductsBean" /><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><% List<Product> all = pb.findAll(); String name = request.getParameter("product"); session.setAttribute("product", name);%><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <style> @import url("entry.css"); table.entry td.left { width: 90px; } </style> </head> <body> <%@ include file="nav.jsp" %> <form method = get action="update.jsp"> <table class="entry"> <tbody valign="top"> <tr> <td class="left">Please choose one:</td> <td> <select name="product"> <option value="">Product ID</option> <% for (Product p : all) {%> <option name="product"><%= p.getId()%></option> <% }%> </select> </td> </tr> </tbody> </table> <input type="submit" name="button" value="Change price"/> <table border="1" cellpadding="5px"> <tr> <th>id</th> <th>description</th> <th>price</th> </tr> <% for (Product p : all) {%> <tr> <td><%= p.getId() %></td> <td><%= StringEscapeUtils.escapeHtml(p.getDescription()) %></td> <td><%= "$" + p.getPrice() %></td> </tr> <% }%> </table> </body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?