Если вы дадите кнопке имя, то она будет доступна только в качестве параметра запроса.
* 1003 Е.Г. *
<input type="submit" name="add" value="Add" />
<input type="submit" name="edit" value="Edit" />
<input type="submit" name="delete" value="Delete" />
с сервлетом
if (request.getParameter("add") != null) {
// Add button was pressed.
} else if (request.getParameter("edit") != null) {
// Edit button was pressed.
} else if (request.getParameter("delete") != null) {
// Delete button was pressed.
} else {
// Handle exceptional/alternative case yourself.
}
или в JSP
<c:choose>
<c:when test="${not empty param.add}">
Add button was pressed.
</c:when>
<c:when test="${not empty param.edit}">
Edit button was pressed.
</c:when>
<c:when test="${not empty param.delete}">
Delete button was pressed.
</c:when>
<c:otherwise>
Handle exceptional/alternative case yourself.
</c:otherwise>
</c:choose>