• Post Reply Bookmark Topic Watch Topic
  • New Topic

Netbeans Enteprise Application versus Web Application

 
Piter Smith
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the distinction between the web component of an Enterprise Application and a Web Application? Assuming Java EE7 and Glassfish for both. I see that a Web Application will create a web.xml, but otherwise I can't tell them apart. It's not like, at least I think it's not like, one of them comes with more JAR's in the classpath? They both build as WAR's, so, again that seems the same. I suppose that web component of an Enterprise Application will bundle with an EAR, if I have that correct, but that's seems like the only distinction. These seem like minor distinctions, so I'm just curious about the way they show up when creating new applications.
 
K. Tsang
Bartender
Posts: 3604
16
Firefox Browser Java Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well from my understanding when you create a new enterprise app (EAR) the "default" name for the ejb and web module/component is <appname>-ejb and <appname>-war. This actually follows the standard naming convention from Sun/Oracle.

But then a pure web app (war) the name can be anything.

Back to the EAR, if you don't create any apps with it at the beginning. You can manually add web/ejb apps, this way the name can be anything.

The major difference I can think of is in the deployment descriptor. A web app (WAR) uses the web.xml welcome page while the enterprise app (EAR) uses the application.xml to tell which module/component to load first.
 
Piter Smith
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how does javaee-web-api vary from javaee-api and how do they fit into this discussion?
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javaee-web-api is a subset of javaee-api that has some packages omitted. Although I am surprised to see that for version 6, javax.jms, javax.xml.messaging javax.xml.registry are the only packages present in javaee-api and not in javaee-web-api. The difference is a bit larger in version 7 (where apparently javax.mail and a few other packages have been removed from javaee-web-api).
 
Piter Smith
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:javaee-web-api is a subset of javaee-api that has some packages omitted. Although I am surprised to see that for version 6, javax.jms, javax.xml.messaging javax.xml.registry are the only packages present in javaee-api and not in javaee-web-api. The difference is a bit larger in version 7 (where apparently javax.mail and a few other packages have been removed from javaee-web-api).



Generally speaking, when are these API's used? Or, more specifically, when would one be used instead of the other?
 
Rob Spoor
Sheriff
Posts: 20817
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you only write web applications using servlets and JSPs, then definitely limit to javaee-web-api. Basically, it's the container that determines whether or not there is an implementation of the API, and if it doesn't implement classes defined in javaee-api and you use that as a dependency, you risk using classes and interfaces that aren't supported.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!