<%@ page language="java" contentType="text/html; charset=gbk"
    pageEncoding="gbk"%>
<%@ page import="java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><%
String strId = request.getParameter("id");
int id = Integer.parseInt(strId);Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost/bbs?user=root&password=root";
Connection conn = DriverManager.getConnection(url);Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("select * from article where id = " + id);%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<title>Insert title here</title>
</head>
<body><%
if(rs.next()) {
%> <table border="1">
<tr>
<td>ID</td>
<td><%=rs.getInt("id") %></td>
</tr>
<tr>
<td>Title</td>
<td><%=rs.getString("title") %></td>
</tr>
<tr>
<td>Content</td>
<td><%=rs.getString("cont") %></td>
</tr>
</table>
<a href="Reply.jsp?id=<%= rs.getInt("id")%>&rootid=<%=rs.getInt("rootid") %>">回复</a>
<%
}
rs.close();
stmt.close();
conn.close();
%>
</body>
</html>org.apache.jasper.JasperException: Exception in JSP: /ShowArticleDetail.jsp:74: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5: <%
6: String strId = request.getParameter("id");
7: int id = Integer.parseInt(strId);
8: 
9: Class.forName("com.mysql.jdbc.Driver"); 
10: String url = "jdbc:mysql://localhost/bbs?user=root&password=root";root cause java.lang.NumberFormatException: null
java.lang.Integer.parseInt(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)
org.apache.jsp.ShowArticleDetail_jsp._jspService(ShowArticleDetail_jsp.java:48)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)