結局したかったことって
委譲なのかも。
ってことで。
@StrutsAction(name = "employee_searchForm", validate = false, scope = ScopeType.SESSION) public interface SearchAction { @StrutsActionForward(path = "/employee/search.html") String SUCCESS = "success"; @DelegatingService(service = GetDepartmentsService.class) DepartmentDto[] getDepartments(); } @StrutsAction(name = "employee_searchForm", scope = ScopeType.SESSION, input = "/employee_search.do") public interface ListAction { @StrutsActionForward(path = "/employee/list.html") String SUCCESS = "success"; @DelegatingService(service = GetEmployeeInfosService.class, args = { "employee_searchForm" }) EmployeeInfoDto[] getEmployeeInfos(); } public interface GetDepartmentsService { @DelegatingService(service = DepartmentDao.class, method = "findAll") DepartmentDto[] execute(); } public interface GetEmployeeInfosService { @DelegatingService(service = EmployeeInfoDao.class, method = "find") EmployeeInfoDto[] execute(EmployeeSearchDto dto); } public interface DepartmentDao { public Class BEAN = DepartmentDto.class; public List findAll(); public DepartmentDto findDto(DepartmentDto dto); } public interface EmployeeInfoDao { public Class BEAN = EmployeeInfoDto.class; public List find(EmployeeSearchDto dto); public EmployeeInfoDto findDto(EmployeeInfoDto dto); }
こんな感じでインターフェースだけで基本的な動作はして細かく制御したければ実装する方向で考えてみよー。
インターフェースだらけになるけど、形の変わった仕様書ってことで。。。ほんとか!?