Added
A company is separating a Java EE 7 application into components while preserving portability across compliant application servers. Each responsibility must be assigned to the Java EE component or container best suited to it. Match each responsibility to its target.
Drag each item onto its matching target. On a phone: tap an item, then tap a target.
- Render dynamic HTML using JSP and servlet request handling → Web container
- Run a transactional business service exposed as a local EJB → EJB container
- Manage an injected contextual object with a request scope → CDI container services
- Package application modules and deployment descriptors together → Enterprise archive
Servlets and JSPs execute in the web container, while EJB components receive services such as container-managed transactions from the EJB container. CDI contextual lifecycle and injection apply through CDI services, including request-scoped beans. An enterprise archive packages Java EE modules and application-level deployment information for deployment. Assigning request handling to the EJB container confuses web and business tiers, and an EAR is a packaging unit rather than an execution container.