0
我正在嘗試使用JSP創建一個在線考試。我想要逐個獲取問題並將它們顯示在屏幕上,然後創建一個「下一步」按鈕,然後用戶可以看到下一個問題,但問題是我不知道如何找出用戶有問題點擊「下一步」按鈕,我知道如何在PHP中:如何找到表單在JSP中提交?
if($_SERVER['REQUEST_METHOD']=='GET')
if($_GET['action']=='Next')
但我不知道如何在JSP中做到這一點。請幫我 這是一張我的代碼:
String result = "";
if (database.DatabaseManager.getInstance().connectionOK()) {
database.SQLSelectStatement sqlselect = new database.SQLSelectStatement("question", "question", "0");
ResultSet _userExist = sqlselect.executeWithNoCondition();
ResultSetMetaData rsm = _userExist.getMetaData();
result+="<form method='post'>";
result += "<table border=2>";
for (int i = 0; i < rsm.getColumnCount(); i++) {
result += "<th>" + rsm.getColumnName(i + 1) + "</th>";
}
if (_userExist.next()) {
result += "<tr>";
result += "<td>" + _userExist.getInt(1) + "</td>";
result += "<td>" + _userExist.getString(2) + "</td>";
result += "</tr>";
result += "<tr>";
result += "<tr> <td colspan='2'>asdas</td></tr>";
result += "</tr>";
}
result += "</table>";
result+="<input type='submit' value='next' name='next'/></form>";
}