2012-07-03 3 views
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의 드롭 다운에서이 값을 인쇄하고 싶습니다. 어떤 도움이 필요합니까? 이

답변

0

당신은 mainform2 속성의 데이터를 설정하고이

items="${mainform2}" 
+0

이 확실하지가 – Namita

+0

당신이 쓴 수행하는 방법' "$ {mainform2.countryList} ''이 사용자가 설정하여 액세스하려고하는 mainform2의 'countryList' 속성은 무엇입니까? –

관련 문제