⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bookedit.jsp

📁 图书馆管理的源代码文件
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.nitpro.webmvc.bean.Book"%>
<%@ page import="java.util.Date"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>图书登记</title>
</head>
<body>

<%
    Book book = new Book();
    Object obj = request.getAttribute("book");
    if(obj != null){
    	book = (Book)obj; 
    }else{
    	book.setBook_id(0);
    	book.setBook_name("");
    	book.setAuthor("");
    	book.setIdbn("");
    	book.setPub_date(new Date());
    	book.setPublisher("");
    	book.setPrice(0);
    }
    String msg = "请填写图书登记信息";
    Object msgObj = request.getAttribute("msg");
    if(msgObj != null){
    	msg = (String)msgObj;
    }
    
    
%>

<h3><%=msg%></h3>


<form action="/books/book" method="post">

<%if(book.getBook_id()>0){%>
<input type="hidden" name="method" value="update">
<%}else{%>
<input type="hidden" name="method" value="new">
<%}%>
<input type="hidden" name="book_id" value="<%=book.getBook_id()%>">

<table>
    <tr><td>名称:</td><td><input type="text" name="book_name" value="<%=book.getBook_name()%>"/></td></tr>
    <tr><td>作者:</td><td><input type="text" name="author" value="<%=book.getAuthor()%>"/></td></tr>
    <tr><td>编号:</td><td><input type="text" name="idbn" value="<%=book.getIdbn()%>"/></td></tr>
    <tr><td>出版日期:</td><td><input type="text" name="pub_date" value="<%=book.getPub_date_str()%>"/><span>格式要求:2008-01-01</span></td></tr>
    <tr><td>出版商:</td><td><input type="text" name="publisher" value="<%=book.getPublisher()%>"/></td></tr>
    <tr><td>定价:</td><td><input type="text" name="price" value="<%=book.getPrice()%>"/></td></tr>
    <tr><td><input type="submit" value="保存"/></td></tr>
</table>


</form>


</body>
</html>

⌨️ 快捷键说明

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