📄 addbook.jsp
字号:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="fuguo.yy1.dto.BookCategory,fuguo.yy1.bo.BookCategoryBO"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>新书上架</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<CENTER>
<%
if(session.isNew()){
response.encodeRedirectUrl("/admin/adminLogin.jsp");
}else{%>
<jsp:include page="/admin/include/top.jsp"></jsp:include>
<%}%>
<%
ArrayList categoryList=(ArrayList)BookCategoryBO.bookCategorys();
if(categoryList.size()>0 && categoryList!=null){
%>
<TABLE align="center" border="1" cellpadding="2" cellspacing="2" width="90%">
<html:form action="/admin/book/addBook.do">
<TR>
<TD bgcolor="#cccccc" width="30%"align="right"><font color="red">图书名称:</font></TD>
<TD><html:text property="bookName" /></TD>
</TR>
<TR>
<TD bgcolor="#cccccc" align="right"><font color="red">图书类别:</font></TD>
<TD><select name="bookCategoryId">
<%
Iterator it=categoryList.iterator();
while(it.hasNext()){
BookCategory bookCategory=(BookCategory)it.next();
%>
<option value="<%=bookCategory.getBookCategoryId() %>"><%=bookCategory.getCategoryName() %></option>
<%}%>
</select></TD>
</TR>
<TR>
<TD bgcolor="#cccccc" align="right"><font color="red">单价:</font></TD>
<TD><html:text property="price" />元</TD>
</TR>
<TR>
<TD bgcolor="#cccccc" align="right">数量:</TD>
<TD><html:text property="amount" />本</TD>
</TR>
<TR>
<TD colspan="2" align="center"><html:submit>添加</html:submit> </TD>
</TR>
</html:form>
</TABLE>
<%}else{%>
<font color="red">目前数据库还没有任何图书类别,所以不能添加图书!</font><br>
您可以必须<a href="<%=path%>/admin/category/addCategory.jsp">添加图书类别</a>
<%}%>
</CENTER>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -