0

この質問は何千回も尋ねられたかもしれませんが、私はこれを機能させることができません.

ページがロードされたときに、データベースからドロップダウン値を入力する必要があります。テーブルのドメインクラスが「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のドロップダウンに出力したいと思います。何か助けはありますか?

4

1 に答える 1

0

属性のどこにデータを設定し、次の方法でデータmainform2にアクセスしようとしていますか

items="${mainform2}"
于 2012-07-03T16:37:58.487 に答える