在一个页面里写
<a href="add.jsp?id=1">增加</a>  
<a href=add.jsp?id=2">编辑</a>
另一个页面里读取
request.getParameter("id")
if (id==null)