SSM图书管理(三)

本文主要展示图书管理jsp页面的编写内容
BookList.jsp

<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
  <head>
      
    <title>图书列表title>	
    <style type="text/css">
        table {
            border: 1px solid black;
            border-collapse: collapse;
        }
        
        table thead tr th {
            border: 1px solid black;
            padding: 3px;
            background-color: #cccccc;
        }
        
        table tbody tr td {
            border: 1px solid black;
            padding: 3px;
        }
    style>   
  head>
  
  <body>
  <div  align="center">
   <h2>图书列表h2>
    <s:form action="book_bookDeletes" theme="simple">
        <table cellspacing="0">
            <thead>
                <tr>
                    <th>selectth>
                    <th>ISBNth>
                    <th>Titleth>
                    <th>Priceth>
                    <th>Operationth>
                tr>
            thead>
            <tbody> 
              <c:forEach items="${cs}" var="c" varStatus="st">
              	<tr>
              		<td>td>
              		<td>${c.isbn}td>
              		<td>${c.title}td>
              		<td>${c.price}td>
              		<td>
              			<a href='loadBook?bookId=${c.bookId}'>Edita>
                    	<a href='deleBook?bookId=${c.bookId}'>Deletea>
              		td>
              	tr>
              c:forEach>  
            tbody>
        table>        
        <s:submit value="RemoveAll" />          
        <p><a href="/SSMBook/curp/BookAdd.jsp">Adda>p>        
  div>
  body>
html>

BookAdd.jsp

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
  <head>
    <title>增加图书title>
  head>
  <body onload="">
  <div align="center"> 增加图书 <br>
   <form action="/SSMBook/addBook" method="post">
   		Isbn:<input type="text" name="Isbn"/>
   		Title:<input type="text" name="Title"/>
   		Price:<input type="text" name="Price"/>
   		<input type="submit" value="提交"/>
   form>
   <a href='/SSMBook/listBook'>返回 a>
   div>
  body>
html>

BookEdit.jsp

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
  <head>
    <title>My JSP 'BookAdd.jsp' starting pagetitle>
  head>
  
  <body>
  <div align="center">edit book <br>
   <form action="/SSMBook/editBook" method="post">
   		<input type="hidden" name="bookId" value='${book.bookId }'/>
   		
   		Isbn:<input type="text" name="Isbn" value='${book.isbn}'/>    
   		Title:<input type="text" name="Title"  value='${book.title}'/>
   		Price:<input type="text" name="Price"  value='${book.price}'>
   		<input type="submit" value="提交"/>
   form>
   div>
  body>
html>

踩坑记录:
bean里面的字段,如果首字母是大写,在JSP中引用的时候首字母一定要改成小写,不然500
就是 Title:的value=’${book.title}'的title一定要首字母小写啊啊啊啊啊啊啊啊啊啊啊

你可能感兴趣的:(SSM)