この質問は何千回も尋ねられたかもしれませんが、私はこれを機能させることができません.
ページがロードされたときに、データベースからドロップダウン値を入力する必要があります。テーブルのドメインクラスが「CountryList」として定義されています
次のようなすべての国のリストを取得しています
@RenderMapping(params = "action=studentPage")
public String studentSetUpPage(RenderRequest request,
RenderResponse response, ModelMap model) {
// some code
ArrayList<CountryList> getAllCountries = serviceClass.getAllCountries(id);
for(CountryList country : getAllCountries){
System.out.println(" Country " + listCountry.getCountry());
}
}
JSP コード
<form action="<%=save%>" method="POST" name="createpage" id="createPage">
<table>
<c:forEach var="mainform1" items="${mainform2}">
<aui:select name="countrySelect" id="countrySelect"
label="Country :" inlineLabel="Country:"
showRequiredLabel="false">
<c:forEach var="countryList"
items="${mainform2.countryList}">
<aui:option label="....."
value="..........">
</aui:option>
</c:forEach>
</aui:select>
</c:forEach>
</table>
</form>
コンソールにすべての国を出力しています。
これらの値をjspのドロップダウンに出力したいと思います。何か助けはありますか?