1.在jsp网页中添加数据时
2.查看网页源代码
<body>
<form method="post" action="Ref/zhuanye.jsp?id=null">
3.jsp代码为
<%
int id=0;
ZhuanYe b=new ZhuanYe();
if(request.getParameter("id")!=null)
{
id=Integer.parseInt(request.getParameter("id"));
b=new ZhuanYeServer().GetByID(id);
}
%>
</head>
<body>
<form method="post" action="Ref/zhuanye.jsp?id=<%=request.getParameter("id") %>">