我正在尝试在JSP页面中获取所选项目的值,当我在本地尝试它时,它可以工作!但是一旦我发布它,它就会停止工作,因为它总是为参数
返回“null”值JSP / JSTL代码:
<form action ="SelectedEntity" method ="get">
<label>Please select one of the following entities: </label>
<select name="Entity">
<c:forEach var = "entity" items ="${entities}">
<option ><c:out value="${entity}"/></option>
</c:forEach>
<input type = "submit" name = "submit" id = "submit" value ="Go">
</select>
</form>
这是servlet:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String entity = request.getParameter("Entity");
这总是返回null ..有人可以帮我吗?