I have a bean called EmployeeRoster:
public class EmployeeRoster {
protected List<Employee> janitors;
protected List<Employee> teachers;
}
In JSP, I want to access the different lists of Employees by type. I know that I can do something like:
${employeeRoster.getJanitors}
However, I have many different types of employees and rather than creating an accessor in the EmployeeRoster for every type, I was hoping to be able to do something like this:
${employeeRoster.get(EmployeeType.JANITOR)} // obviously, not valid
Is this possible in JSP? Can I apply a parameter to a bean accessor call?