I'm new to Spring; my first Spring project is using Struts as the web tier.

Two common options for integrating Spring with Struts, according to the "Professional Java Development with the Spring Framework" book, are:

1) use the DelegationRequestProcessor class

2) using an auto wiring base action

According to the examples in the book, it looks like both these options require the beans to be set as instance attributes in the Struts Action. My concern is that these beans will not be threadsafe (if my understanding is correct, Spring beans can be non-singletons if desired).

Admittedly it would be desirable in most conceivable models to have a singleton business bean called from the web tier, but equally I think its desirable not to be locked in to this.

As an alternative, how about a simple getBean() method which could be defined in a BaseAction class (extending ActionSupport) as follows:

public Object getBean(String beanID) {
return this.getWebApplicationContext().getBean(beanID);
}

Thoughts and replies on this are welcome,

thanks,

John