I have following Project Structure:
- Shared Frameworkproject (plain java maven, includes all Business, DAO logic and Models) with 90% Singletons
- JSF-Application which uses the Frameworkproject and just adds Managedbeans and views which consume the business logic (no maven)
see an example at another question: JSF Singleton Services/DAO/.. vs ApplicationScope
Now I want to refactore the Frameworkproject to be Spring-compatible to be able to use dependency injection in all other related projects.
So this also affects the JSF 2.0 Application and therefore I have some Questions as I was not able to get things to work until hours of attempts:
- Is this a proper way to build a new architecture (JSF with Spring) - are they fully compatible or is some part not 100% working after that
- Can I just use @Autowired in Session/ViewScoped-ManagedBeans for my @Service-Classes of the Frameworkproject? Do I need a setter like ManagedProperties in JSF as well?
- Do I need a applicationContext.xml in both projects or only in one (where the component-scan is defined)
- I just want to make the application multi-user-"able" together with spring. If thats not a good way to achieve this, I am happy to know.
- what is the minimal working set of spring-configuration in my Projects to get things to work (I don't need Spring-MVC and stuff like that because I have jSF)