![]() ![]() | ||||||||||||||||||||
| Home>>>>> | ||||||||||||||||||||
Apache Jakarta StrutsStruts is a framework based on Model-View-Controller. html:selectNested within a html:select are: html:optionIndividual options are listed, one per entry html:optionsmany html:optionsCollectionCreate a collection of beans. In the example below a collection of Accounts has been added to request scope. [
List<Account> accounts = getAccountingService().getAccounts();
request.setAttribute("accounts", accounts);
The account bean has an id, and a currency property. The getters are hidden. [
public class Account {
private Long id;
private Currency currency;
}
JSP code is below. [
<html:select property="id">
<html:optionsCollection name="accounts" value="id" label="currency"/>
</html:select>
Links
| ||||||||||||||||||||