문제

I have this problem:

I need to create a BaseAction for a java web application (with Struts 1). All the actions will extend this BaseAction and all the actions have more methods (create, update, delete, list, etc). There's no "execute" method.

I need this in order to get the ApplicationContext for spring but also for authentication or other things that all actions should do.

When there's only "execute" method the things are easy...just create the BaseAction with "execute" method and an abstract "performTask" method. The "forward" will be the result of the "performTask" method that all other actions will implement.

So I can't do the same design for actions that have more than one method and every method has its own forward.

Thanx, Adri108

도움이 되었습니까?

해결책

In Struts 1, struts-config.xml is a driving file. This file redirects various actions to respective ActionForward method.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top