我有上的問題預先選擇的值的與支柱2如何預選擇上選擇一個選項(在Struts 2)
我使用的標記值=「國家」定位到String country =「Japan」,select從列表(字符串列表)中加載元素。
但是,在加載時,select只是針對列表中的第一項。
看:
<s:select list="countries" value="country" label="Conutry"
headerKey="null" name="country" id="selectCountry"
/>
public List<String> countries;
public String country;
.....
public Countries(){
countries=dao.list();
}
.........
getter and setter
........
//Action Used to get information
public getInfo(){
country="USA"
}
在代碼'contry' vs'country'中有錯字嗎? –
哈哈對不起,我寫的問題的錯誤!..但是在muy代碼是正確的..謝謝! – rafuru