CDI on Tomcat 7 - does it make sense?

前端 未结 2 1265
旧巷少年郎
旧巷少年郎 2021-01-04 01:32

If I can choose, I use JBoss 7 for a Java EE 6 project using JSF 2 and CDI.

But sometimes, the environment for a customer\'s project is more or less set - so in one

相关标签:
2条回答
  • 2021-01-04 01:50

    Good question, first of all :)

    Deploying an enterprise application to a servlet engine is the main scenario of e.g. Spring, so it is certainly possible. But you will know that Spring is a whole ecosystem of APIs and config-files rather than a few JARs that you simply put on the server and have fun with.

    I played quite a bit with Weld & JSF on Tomcat 7, and it worked pretty good. But there is a major difference between HelloWorldOnTomcat.java and a real application for real customers. I'm sure that you are aware of this.

    I'd say that you will be able to compile a decent setup in relative short time. Neither CDI nor JSF will be problematic. But depending on your concrete requirements you then will have to deal with other aspects that are not covered by an out-of-the-box Tomcat. Security, clustering, fail-over, messaging, asynchronity to name a few concerns (And transactions, as mentioned in the comments).

    If you are (more or less) proficient with such requirements and your upcoming project is rather relaxed and not supposed to control the next Mars mission - I'd certainly give it a try.

    On the other hand if you know about such requirements I'd look for (a) a setup on a Java EE app server, or (b) another stack on a Tomcat.

    0 讨论(0)
  • 2021-01-04 01:57

    Take a look at Apache Tomee:

    Apache TomEE, pronounced "Tommy", is an all-Apache Java EE 6 Web Profile certified stack where Tomcat is top dog. Apache TomEE is assembled from a vanilla Apache Tomcat zip file. We start with Tomcat, add our jars and zip up the rest. The result is Tomcat with added EE features - TomEE.

    0 讨论(0)
提交回复
热议问题