开发者

Submit form and get selected data from dropdownlist in a servlet

开发者 https://www.devze.com 2023-03-05 05:05 出处:网络
i have a doPost() method protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOExceptio开发者_Go百科n {

i have a doPost() method

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOExceptio开发者_Go百科n {
    LOGGER.debug("Form Submitted with username: " + request.getAttribute("username"));
}

and my JSP

<select name="username" onchange="this.from.submit();">
  <c:forEach var="ovr" items='${overrides}'>
    <option value="${ovr.overrideId}">${ovr.userId}</option>
  </c:forEach>
</select>

there's nothing logged, this suggests the form wasn't submitted...


Your onchange says this.from.submit() and not this.form.submit()

0

精彩评论

暂无评论...
验证码 换一张
取 消