Computer Knowledge

Java Enterprise and Web Technologies

2,183 Questions

Java enterprise and web technologies questions focus on J2EE architecture, web services like SOAP, and servlet functionalities. These topics frequently appear in IT officer and specialist scale examinations. Regular practice ensures familiarity with enterprise application components.

HttpServlet methodsSOAP and web servicesEJB architecture rolesJ2EE componentsJSP servlet callingUDDI concepts

Java Enterprise and Web Technologies Questions

Multiple choice technology architecture
  1. EntityBean

  2. StatefulSession Bean

  3. MessageDrivenBean

  4. StatelessSessionBean

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

MessageDrivenBeans in EJB cannot have local or remote interfaces because they are designed to process asynchronous messages via JMS (Java Message Service). Unlike session or entity beans, MessageDrivenBeans are implemented as message listeners and are not intended for direct client invocation through business interfaces.

Multiple choice technology architecture
  1. Object

  2. void

  3. String

  4. Boolean

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The @PrePassivate annotation in EJB indicates a callback method that is invoked before a stateful session bean is passivated (temporarily serialized to secondary storage). Like other lifecycle callback methods such as @PostConstruct and @PreDestroy, it must return void and throw no checked exceptions.

Multiple choice technology architecture
  1. construction

  2. destruction

  3. activation

  4. passivation

  5. All the above

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

Stateful session beans in EJB undergo all these lifecycle transitions: construction (when created), destruction (when removed), activation (when restored from secondary storage), and passivation (when temporarily serialized). These callbacks allow the bean to manage its state through the complete lifecycle.

Multiple choice technology architecture
  1. Bean Provider

  2. Application Assembler

  3. Deployer

  4. System Administrator

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The Application Assembler is responsible for assembling enterprise beans into application modules and can override transaction attributes defined by the Bean Provider. The Deployer then deploys these assembled modules, while System Administrators manage runtime resources. The Bean Provider only defines default transaction attributes.

Multiple choice technology architecture
  1. EJB architecture defines distributed component based architecture for business applications

  2. EJB is a standard that is built on top of Web Services architecture

  3. EJB Architecture is language independent, meaning that it is possible to write components using any programming language.

  4. none

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

EJB architecture defines a distributed component-based architecture for building enterprise business applications. It provides services like transaction management, security, and persistence while allowing developers to focus on business logic. EJB is Java-specific (not language-independent) and predates Web Services, being built on RMI-IIOP, not Web Services architecture.

Multiple choice technology architecture
  1. Does not exist

  2. Pooled State

  3. Passive

  4. None

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In EJB specifications, the lifecycle states of a Stateless Session Bean are limited to 'Does not exist' and 'Method-ready pool' (or 'Pooled'). Among the choices, 'Does not exist' is the standard lifecycle state. 'Passive' only applies to stateful session beans during passivation.

Multiple choice technology platforms and products
  1. Get Context

  2. Invoke Partner

  3. SOAP Request Reply

  4. Partner Link Configuration

Reveal answer Fill a bubble to check yourself
B,D Correct answer
Explanation

To invoke an external web service in TIBCO BusinessWorks, you need both the Invoke Partner activity (which makes the actual call) and a Partner Link Configuration (which defines the web service endpoint, WSDL, and binding details). Get Context is for retrieving context variables, and SOAP Request Reply might seem plausible but is not the standard activity for this purpose - Partner Link is the correct mechanism.

Multiple choice technology architecture
  1. NotSupported

  2. Required

  3. RequiresNew

  4. Supports

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

For Container-Managed Transactions (CMT), the default transaction attribute is 'Required', meaning the method must always execute within a transaction. If none exists, the container creates one. NotSupported, RequiresNew, and Supports are all valid attributes but must be explicitly specified - they are not defaults.

Multiple choice technology architecture
  1. construction

  2. destruction

  3. activation

  4. passivation

  5. All the above

Reveal answer Fill a bubble to check yourself
E Correct answer
Explanation

Stateful session beans support all four callback types: construction (PostConstruct), destruction (PreDestroy), activation (PostActivate), and passivation (PrePassivate). These lifecycle events allow the container to manage bean state when passivating to secondary storage or activating back into memory.

Multiple choice technology architecture
  1. post construction

  2. pre destroy

  3. both a and b

  4. none of the above.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Stateless session beans only support two lifecycle callbacks: PostConstruct (after creation) and PreDestroy (before removal). They don't support activation/passivation because they don't maintain conversational state - instances are pooled and interchangeable.

Multiple choice technology architecture
  1. Post Construction

  2. Pre Destruction

  3. Post Activation

  4. Pre Construction

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The lifecycle methods for Stateful Session Beans are: PostConstruct (after creation), PreDestroy (before removal), PostActivate (after passivation), and PrePassivate (before passivation). There is no 'Pre Construction' lifecycle method - construction happens before PreConstruct, not after. PreConstruction would imply something happens before the bean exists, which is impossible.

Multiple choice technology architecture
  1. Embedding of Java code in HTML pages

  2. Platform independence

  3. Creation of database-driven Web applications

  4. Server-side programming capabilities

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The key advantage of JSP over Servlet is that it allows embedding Java code directly in HTML, making it easier to maintain the presentation layer. Options B, C, and D are capabilities shared by both JSP and Servlets - they're platform-independent, can create database-driven apps, and both are server-side technologies.

Multiple choice technology architecture
  1. jspInit(), _jspService() & jspDestroy()

  2. init(), service(), destroy()

  3. doPost()

  4. none of the above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

JSP lifecycle methods are jspInit() (called once when JSP is initialized), _jspService() (called for each request, equivalent to service() in servlets), and jspDestroy() (called when JSP is destroyed). Option B lists servlet lifecycle methods. Option C is only one method (doPost is HTTP method handler, not lifecycle).

Multiple choice technology architecture
  1. View

  2. Model

  3. Controller

  4. None

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In the MVC (Model-View-Controller) architecture, JSP serves as the View component - it handles presentation and display. The Model represents data and business logic. The Controller (often a Servlet) handles request processing and coordinates between Model and View.