在我的控制器中我已经写了如下填充国家列表和状态列表填充状态下拉(){基于国家下拉的在Java春天选择
List <State> states = stateService.findAllStates();
return states;
}
而在我的JSP中,我已填充在国家和地区成功状态:
<form:select path="country" id="country">
<form:option value="">Select Country</form:option>
<form:options items="${countries}" itemValue="countryCode" itemLabel
= "countryName" />
</form:select>
<form:errors path="country" cssClass="error"/>
<form:select path="state" id="state">
<form:option value="">Select Country</form:option>
<form:options items="${states}" itemValue="stateCode"
itemLabel="stateName" />
</form:select>
<form:errors path="state" cssClass="error"/>
但我需要根据国家的选择填充状态。
你必须使用JavaScript来实现这一点。 –