2011-12-24 16 views

答えて

0

html selectタグは、selectタグのプロパティと同じ値を持つオプションを自動的に選択します。だから、あなたのフォームBeanがgetFoo()方法と、このメソッドが返す「バー」を持っている場合は、次のselectタグが値とそのオプションが表示されます「バー」を選択:

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

いくつかのオプション選択を行うためには、単にその値を入れますフォームBeanのプロパティで:

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

// in the JSP 
<html:select property="foo"> 
    list of options 
</html:select> 
関連する問題