Skip to content

Apache Jakarta Struts

Struts is a framework based on Model-View-Controller.

Nested within a html:select are:

Individual options are listed, one per entry

many

Create 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 not shown.

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>

The Apache Struts Web Application Framework