<%@ page language="java" import="java.util.*,org.entity.*"
pageEncoding="utf-8"%>
<%
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>My JSP 'MyJsp.jsp' starting page</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">
-->
<%
String bookname;
int bookid = 0;
int bookno = 0;
if (request.getAttribute("entity") == null) {
Entity entity = new Entity();
bookname = (String) entity.getBookname();
bookid = entity.getBookid();
bookno = entity.getBookno();
} else {
Entity entity = (Entity) request.getAttribute("entity");
bookid = entity.getBookid();
bookno = entity.getBookno();
bookname = entity.getBookname();
}
%> </head>
<body>
<form method="post" action="SearchServlet" id="form1" name="form1">
<center>
<h1>
图书查询
</h1>
<table>
<tr>
<td>
图书名称
<input type="text" name="search" id="search">
</td>
<td>
<input type="submit" name="submit" value="查询">
</td>
<td>
<input type="reset" name="reset" value="重置">
</td>
</tr>
</table>
<table align="center" border="3" width="80%">
<tr align="center">
<td>
图书序号
</td>
<td>
图书编号
</td>
<td>
图书名称
</td>
</tr>
<tr align="center">
<td> <%=bookid%>
</td>
<td>
<%=bookno%>
</td> <td>
<%=bookname%>
</td>
</tr>
</table>
</center>
</form>
</body>
</html>在红色部分代码中;没有查询的时候,他的默认值显示是0,如何让他有值时候显示,没值就不显示