package com.demo.bean; public class Book {//教材 private long id; private String bookId;//教材ID private String name;//教材名称 private String price;//价格 private String author;//编者 private String publisher;//出版社 private String profession;//专业 private String channel;//渠道 private String appendix;//备注 public Book() {} public Book(long id, String bookId, String name, String price, String author, String publisher, String profession, String channel, String appendix) { this.id = id; this.bookId = bookId; this.name = name; this.price = price; this.author = author; this.publisher = publisher; this.profession = profession; this.channel = channel; this.appendix = appendix; } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getBookId() { return bookId; } public void setBookId(String bookId) { this.bookId = bookId; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public String getPublisher() { return publisher; } public void setPublisher(String publisher) { this.publisher = publisher; } public String getProfession() { return profession; } public void setProfession(String profession) { this.profession = profession; } public String getChannel() { return channel; } public void setChannel(String channel) { this.channel = channel; } public String getAppendix() { return appendix; } public void setAppendix(String appendix) { this.appendix = appendix; } @Override public String toString() { return "Book [id=" + id + ", bookId=" + bookId + ", name=" + name + ", price=" + price + ", author=" + author + ",
时间: 2024-04-06 19:29:13 浏览: 162
publisher=" + publisher + ", profession=" + profession + ", channel=" + channel + ", appendix=" + appendix + "]"; } }
这是一个 Java 类,表示一个教材(Book)对象,包括教材的 ID、名称、价格、编者、出版社、专业、渠道和备注等属性。其中包含了一个无参构造函数和一个有参构造函数,以及对应的 getter 和 setter 方法。此外,还重写了 toString 方法,以便于在需要打印该对象时,可以直接输出其属性值。
相关问题
<a href="${pageContext.request.contextPath}/book/toUpdateBook?id={book.bookID}">修改</a>
这是一个链接,当用户点击它时,会请求路径为"${pageContext.request.contextPath}/book/toUpdateBook?id={book.bookID}"的页面,其目的是修改相关的内容。
</div> </form> <div class="row clearfix"> <div class="col-md-12 column"> <table class="table table-hover table-striped"> <thead> <tr> <th>书籍编号</th> <th>书籍名字</th> <th>书籍数量</th> <th>书籍详情</th> <th>操作</th> </tr> </thead> <tbody> <c:forEach var="book" items="${booksList}"> <tr> <td>${book.bookID}</td> <td>${book.bookName}</td> <td>${book.bookCounts}</td> <td>${book.detail}</td> <td> <a href="${pageContext.request.contextPath}/book/toUpdateBook/${book.bookID}">更改</a> | <a href="${pageContext.request.contextPath}/book/deleteBook/${book.bookID}">删除</a> </td> </tr> </c:forEach> </tbody> </table> </div> </div>改为html语言
以下是将该段代码转换为 HTML 语言的结果:
```html
</div>
</form>
<div class="row clearfix">
<div class="col-md-12 column">
<table class="table table-hover table-striped">
<thead>
<tr>
<th>书籍编号</th>
<th>书籍名字</th>
<th>书籍数量</th>
<th>书籍详情</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<!-- 使用 JSTL 标签库循环遍历 booksList 集合 -->
<c:forEach var="book" items="${booksList}">
<tr>
<td>${book.bookID}</td>
<td>${book.bookName}</td>
<td>${book.bookCounts}</td>
<td>${book.detail}</td>
<td>
<a href="${pageContext.request.contextPath}/book/toUpdateBook/${book.bookID}">更改</a>
|
<a href="${pageContext.request.contextPath}/book/deleteBook/${book.bookID}">删除</a>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
```
需要注意的是,由于该段代码中使用了 JSTL 标签库,因此在将其转换为 HTML 语言时需要将其中的 JSTL 标签替换为相应的 HTML 标签或属性。在上面的代码中,`<c:forEach>` 标签用于循环遍历 `booksList` 集合,因此在 HTML 中需要使用 JavaScript 或其他方式实现相同的功能。
阅读全文