开发者

How to setup a Spring multimodule project?

I'm new to Spring and try to setup a project which is split into 3 submodules. As build tool I'm using maven. My problem is, that I don't know where to add Springs "magic". My 3 submodules are "ORM" (holds all the hibernate staff to access the database) "BusinessLogic" (which should hold the complete logic) and "WebApp" (adds as the only "client" to the app / logic).

I want to use SpringMVC for the WebApp which seems to be no problem. As "BusinessLogic" should hold the complete logic I thought of adding the Spring related stuff (Bean definition / DI) in that module. But then I don't know how to setup开发者_高级运维 Spring when accessing the module form the webapp.

The hole project is being ported from a JavaEE / JBoss app where "ORM" and "BusinessLogic" (implemented as EJBs) where put into one .ear archive and the webapp into a seperate one (.war). JNDI was used to access the beans from the webapp, but I completely want to decouple the application from JBoss and deploy it on a Tomcat webserver.

At the moment I've created all three modules as separate Maven projects ("ORM" and "BusinessLogic" as .jar, "WebApp" as .war packaging), linked by a "parent" project.

Thanks for any hints on project setup :).

Greetings Ben


you could configure spring context in your web.xml and you can perform import of Spring sub-modules context. You can add import's configuration of sub-modules in your webApp application context.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜