struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Fisher <>
Subject JSTL and enums
Date Mon, 05 Apr 2004 05:28:36 GMT
Hi everyone,

I have been given the enjoyable job of converting our jsp files from
scriplet code to jstl and I have come accross this problem. I need to
convert the following line:

Naturally TransactionType was already imported, so I've set the enum list to
the pageContext with the following:
List transactionTypes = TransactionType.getEnumList();
pageContext.setAttribute("transactionTypes",  transactionTypes);

but I'm not sure where to go from here.

Below is the class TransactionType for a clearer picture. Any help would be
greatly appreciated.


********** ********** ********** ********** ********** 
public class TransactionType extends ValuedEnum {
	public static final TransactionType newLine = new
TransactionType("New Line", 1);
	public static final TransactionType packChange = new
TransactionType("Pack Change", 2);
	public static final TransactionType priceChange = new
TransactionType("Price Change", 3);

	private TransactionType(String name, int value) {
		super(name, value);

	public static TransactionType getEnum(String name) {
		return (TransactionType) getEnum(TransactionType.class,

	public static TransactionType getEnum(int value) {
		return (TransactionType) getEnum(TransactionType.class,

	public static Map getEnumMap() {
		return getEnumMap(TransactionType.class);

	public static List getEnumList() {
		return getEnumList(TransactionType.class);

	public static Iterator iterator() {
		return iterator(TransactionType.class);

********** ********** ********** ********** ********** 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message