2011-12-24 28 views

回答

0

html選擇標籤自動選擇具有與選擇標籤的屬性相等的值的選項。所以,如果你的form bean有getFoo()方法,該方法返回「吧」,下面選擇標籤將其與價值「欄」選項中選擇:

<html:select property="foo"> 
    list of options 
</html:select> 

要選擇一些選項,只是把它的值在form bean的屬性中:

// in the action 
form.setFoo("bar"); 

// in the JSP 
<html:select property="foo"> 
    list of options 
</html:select>