📄 bookform.jsp
字号:
<%@page contentType="text/html"%><%@taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%><%@taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt"%><%@taglib prefix="html" uri="http://jakarta.apache.org/struts/tags-html-1.0"%><%@taglib prefix="bean" uri="http://jakarta.apache.org/struts/tags-bean-1.0"%><%@taglib prefix="logic" uri="http://jakarta.apache.org/struts/tags-logic-1.0"%><c:set var="isEditor" value="${false}"/><logic:present role="editor"> <c:set var="isEditor" value="${true}"/></logic:present><table width="100%"> <tr> <td width="60%" valign="top"> <html:form action="/book/aud" onsubmit="return validateBookForm(this)"> <table> <tr> <td colspan="2"><html:errors/></td> </tr> <tr> <td width="20%"><bean:message key="book.title.label"/></td> <td><html:text property="title" maxlength="255" size="40" readonly="${not isEditor}"/></td> </tr> <tr> <td><bean:message key="book.authors.label"/></td> <td><html:text property="authors" maxlength="255" size="40" readonly="${not isEditor}"/></td> </tr> <tr> <td><bean:message key="book.editor.label"/></td> <td><html:text property="editor" maxlength="255" size="40" readonly="${not isEditor}"/></td> </tr> <tr> <td valign="top"><bean:message key="book.chapters.label"/></td> <td><html:textarea property="chapters" cols="31" rows="10" readonly="${not isEditor}"/></td> </tr> <tr> <td><bean:message key="book.pagecount.label"/></td> <td><html:text property="pageCount" size="5" readonly="${not isEditor}"/></td> </tr> <tr> <td><bean:message key="book.price.label"/></td> <td> <input type="text" name="price" size="5" <c:if test="${not $isEditor}">readonly</c:if> value="<fmt:formatNumber value='${bookForm.price}' pattern='0.00'/>"> </td> </tr> <tr> <td><bean:message key="book.status.label"/></td> <td> <html:select property="status"> <html:option key="book.status.planned" value="P"/> <html:option key="book.status.inprogress" value="I"/> <html:option key="book.status.completed" value="C"/> </html:select> </td> </tr> <tr> <td></td> <td align="right"> <c:if test="${isEditor}"> <c:choose> <c:when test="${param.mode=='add'}"> <html:submit property="action"> <bean:message key="book.add.button.label"/> </html:submit> </c:when> <c:otherwise> <html:submit property="action"> <bean:message key="book.update.button.label"/> </html:submit> <html:submit property="action" onclick="bCancel=true;"> <bean:message key="book.delete.button.label"/> </html:submit> </c:otherwise> </c:choose> </c:if> <html:cancel onclick="bCancel=true;"> <bean:message key="book.cancel.button.label"/> </html:cancel> </td> </tr> </table> <input type="hidden" name="mode" value="${param.mode}"> <html:javascript formName="bookForm"/> </html:form> </td> <td width="40%" valign="top"> <c:if test="${param.mode=='edit'}"> <table> <tr> <th class="portlet"> <bean:message key="book.news.title" arg0="${bookForm.title}"/> </th> </tr> <tr> <td class="portlet"> <table> <c:forEach var="item" items="${bookForm.news}" end="10"> <tr> <td class="title"> <c:choose> <c:when test="${isEditor || item.user==pageContext.request.remoteUser}"> <html:link page="/book/news/edit.do?id=${item.id}"> ${item.title} </html:link> </c:when> <c:otherwise>${item.title}</c:otherwise> </c:choose> </td> </tr> <tr> <td> ${item.body} [<fmt:formatDate value="${item.published}" type="both" dateStyle="short" timeStyle="short"/>] </td> </tr> </c:forEach> <c:if test="${empty bookForm.news}"> <tr> <td class="title"><bean:message key="book.news.nonews"/></td> </tr> </c:if> <tr> <td align="right"> <html:link page="/book/news/add.do"> <bean:message key="book.news.add.link"/> </html:link> </td> </tr> </table> </td> </tr> </table> </c:if> </td> </tr></table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -