문제

What is the difference between a WAR and a EAR application? I got this .war vs .ear file but yet no hint. Are there any practical examples which can explain when to use which? Yes I mean if I have an application (say, online shopping cart), why would I package it as a EAR instead of packaging it as a WAR?

도움이 되었습니까?

해결책

Assuming you'd have an online shop, you'd package it in a WAR if it only contains static resources (html, css, javascript) and servlets/jsps/java classes, so standard java web components.

You'd package it into an EAR if you want to add Java EE capabilities such as EJBs (message-driven, session or container-managed beans), enterprise messaging or combine multiple .wars and .jars into one application archieve.

Typically the disctinction is that if you want EJBs, you go with EARs, otherwise go with WARs.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top