Frage

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?

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top