我的页面.jsp
<s:select name="classId" id="class_select" value="classId" list="yourClassList" onchange="classChanged(this.value)"/>
<s:select id="sec_select" list="yourSecList"/>
Javascript
function classChanged(value){
var url="getSectionsOfClass?classId="+value;
window.location=url;
}
struts.xml
<action name="getSectionsOfClass" class="com.xx.action.GetSectionOfClass">
<result name="success">MyPage.jsp</result>
</action>
在GetSectionOfClass
declareclassId
和(使用 getter/setter)中,yourClassList
并yourSecList
使用您的业务逻辑填充列表。yourClassList
将包含所有类,而yourSecList
将包含基于classId
.