Search code examples
javajava-ee-6packaging

Java EE 6 Project Packaging question


I read on the internet that with Java EE6, you could package EJB3 into a jar and use it in a web application written in JSF2.0. You then package the JSF and EJB jar into a .war file and deploy it to an application server – Glassfish for example.

My question is, if you also want to expose the EJBs as web services, how do you do this? Do you just need to add annotations to the EJBs and have one war file, or there should be another web application just for the web service exposure?


Solution

  • You can do it either way: you could have a war project that simply exposes services and another one with the web interface components, or you can serve the services and the ui from one war. That main reason to go with a separate war would be if you could see either supporting a distributed architecture where the services and web interface components are served from different instances, or, if you could imagine deployments that are services only.