Home  >  Article  >  Database  >  mysql-jsp页面中c:forEach从数据库循环出的多个name的值如何传递到servlet中并写入数据库

mysql-jsp页面中c:forEach从数据库循环出的多个name的值如何传递到servlet中并写入数据库

WBOY
WBOYOriginal
2016-06-06 09:44:442110browse

mysqlservlethibernatejsp问题

我的四种题目是来自四个表中 都是自增列 但是在jsp提取的相应题目号不是顺序+1的

<code><h1> 单选题:</h1>
<br> <foreach items="${Indivlist}" var="ind">         ${ind.question}<br>    <input type="radio" name="a${ind.iid}" value="a">A:${ind.iansa}    <input type="radio" name="a${ind.iid}" value="b">B:${ind.iansb}    <input type="radio" name="a${ind.iid}" value="c">C:${ind.iansc    <input type="radio" name="a${ind.iid}" value="d">D:${ind.iansd}<br><br>    </foreach><hr size="2" color="#5599ff"></code>

多选题:


<code>    <foreach items="${Multilist}" var="mul">          ${mul.mquestion}<br>    <input type="checkbox" name="b${mul.mid}" value="a">${mul.mansa}    <input type="checkbox" name="b${mul.mid}" value="b">${mul.mansb}    <input type="checkbox" name="b${mul.mid}" value="c">${mul.mansc}    <input type="checkbox" name="b${mul.mid}" value="d">${mul.mansd}<br><br>    </foreach><hr size="2" color="#5599ff">   </code>

判断题:


<code>     <foreach items="${Judgelist}" var="jud">         ${jud.jquestion}<br>    <input type="radio" name="c${jud.jid}" value="yes">是    <input type="radio" name="c${jud.jid}" value="no">否<br><br>    </foreach><hr size="2" color="#5599ff"></code>

问答题:


<code>     <foreach items="${Anslist}" var="an">        ${an.ajquestion}<br>    <textarea name="d${an.aid}" cols="100" rows="3"></textarea><br><br>    </foreach><input type="submit" value="完成问卷"></code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn