Which package approach is correct?

A developer wants to package an enterprise bean FooBean within a .war file:
@Stateless
public xlass FooBean {
public void foo () {}
}
Which package approach is correct?

A developer wants to package an enterprise bean FooBean within a .war file:
@Stateless
public xlass FooBean {
public void foo () {}
}
Which package approach is correct?

A.
/ (Root)
I � META � INF /
I � acme
I � FooBean.class

B.
/ (Root)
I � acme
I � FooBean.class

C.
/ (Root)
I � WEB � INF /
I � acme
I � FooBean.class

D.
/ (Root)
I � WEB � INF /
I � Classes/
I � acme
I � FooBean.class

Explanation:
To include enterprise bean class files in aWARmodule, the class files should be in
the
WEB-INF/classes directory.

Note: Enterprise beans often provide the business logic of a web application. In these cases,
packaging the enterprise bean within the web applicationsWARmodule simplifies deployment and
application organization. Enterprise beans may be packaged within aWARmodule as Java
programming language class files or within a JAR file that is bundled within theWARmodule.
Reference: The Java EE 6Tutorial, Packaging Enterprise Beans inWAR Modules



Leave a Reply 0

Your email address will not be published. Required fields are marked *