In a J2EE application, modules are packaged as EAR, JAR, and WAR based on their functionality.
If you use only Servlet, JSP, GIF, and HTML files. Then use .WAR
WAR:(Web ARchive) Web modules which contain Servlet class files, JSP Files, supporting files, GIF and HTML files are packaged as JAR file with .war (web archive) extension.
If you use different EAV JAVA modules, such as (EJB + Servlet, JSP, GIF and HTML files + other technologies). Then use .EAR
EAR: (Enterprise ARchive) All above files (.jar and .war) are packaged as JAR file with .ear (enterprise archive) extension and deployed into Application Server.
Bharti rawat
source share