borrowbook.jsp

来自「基于myeclipse环境开发的一个包含hibernate实现持久层」· JSP 代码 · 共 59 行

JSP
59
字号
<%@ page language="java"%>
<%@ page isELIgnored="false"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%> 
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
 
<html> 
        <head>
                <title>Show customers</title>
        </head>
        <body>
        <html:form action="bookEdit">
        <table border="1">
        <tbody>
        <%-- set the header --%>
        <tr>
                <td>Last name</td>
                <td>Name</td>
                <td>Borrow</td>
        </tr>
        
        <%-- start with an iterate over the collection users --%>
        <logic:present name="customers">
        <logic:iterate name="customers" id="customer">
        <tr>
                <%-- book informations --%>
                <td><bean:write name="customer" property="lastname" /></td>
                <td><bean:write name="customer" property="name" /></td>
                <td><html:radio property="customerId" value="${customer.id}" /></td>
        </tr>
        </logic:iterate> 
        </logic:present>
        <%-- end interate --%>
        
        <%-- if customers cannot be found display a text --%>
        <logic:notPresent name="customers">
                <tr>
                        <td colspan="5">No customers found.</td>
                </tr>
        </logic:notPresent>     
        </tbody>
        </table>
        
        <%-- set the book id to lent --%>
        <html:hidden property="id" />
        
        <%-- set the parameter for the dispatch action --%>
        <html:hidden property="do" value="saveBorrow" />        
        
        <%-- submit and back button --%>
        <html:button property="back" 
                                 onclick="history.back();">
                                 Back
        </html:button>
        &nbsp;
        <html:submit>Save</html:submit>
        </html:form>
        </body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?