clubBoard 表的字段
public class ClubBoard implements java.io.Serializable { // Fields /**
 * 
 */
private static final long serialVersionUID = 8452179022803201281L; private Integer BId; private Company company; private String BName; private Set clubSections = new HashSet(0);clubSection 表的字段
public class ClubSection implements java.io.Serializable { // Fields /**
 * 
 */
private static final long serialVersionUID = -2340580957701774443L; private Integer SId; private ClubBoard clubBoard; private String SName; private Integer SClickCount; private Integer STopicCount; private Set clubTopics = new HashSet(0);
JSP页面如何获取第1个下拉框里面的值,在第2个下拉框里面获取到
          <select id="clubBoard" name="clubBoard" onChange="showCS(this.value)">
<option value=0>---请选择---</option>
<%
for(ClubBoard clubBoard:clubBoardList){
out.print("<option value='"+clubBoard.getBId()+"'>"+clubBoard.getBName() +"</option>");
          }
%>
</select>
         <select name="clubSection" id="clubSection">
<option value=1>---请选择---</option>
<%
for(ClubSection clubsection:clubSectionList)
{ out.print("<option value='"+clubsection.getSId()+"'>"+clubsection.getSName()+"</option>");
 %> <%} %>
</select>

解决方案 »

  1.   

    也就是好一个联动嘛,
    先弄一个全局变量idfor(ClubBoard clubBoard:clubBoardList){
       id = clubBoard.BId;
    }下面用这个id就可以了
      

  2.   

    如果不想刷新  就用ajax
      

  3.   

    写JavaScript调用showCS方法 showCS(data){
       document.all.clubSection.value=data;
    }这样不就得到了么document.getElementById('clubSection').value
      

  4.   

    document.getElementById("clubBoard").options.value;