Computer Knowledge

Java Enterprise and Web Technologies

2,279 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. 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.

Multiple choice technology architecture
  1. Applets

  2. Web Browsers

  3. Wireless clients.

  4. All the above

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

J2EE supports multiple client types for accessing enterprise applications. Applets are client-side Java programs that run in browsers. Web browsers are the most common J2EE clients using HTTP. Wireless clients include mobile devices and PDAs that access J2EE applications through WAP or similar protocols. Since all three are valid J2EE client types, option D is correct.

Multiple choice technology architecture
  1. True

  2. False

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

The statement is false because while HTTP-based servlets extend HttpServlet, the Servlet API also supports generic servlets that extend javax.servlet.GenericServlet. GenericServlet is protocol-independent and can be used for any protocol, not just HTTP. HttpServlet specifically handles HTTP requests and responses.

Multiple choice technology architecture
  1. True

  2. False

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

The JSP translation to servlet happens only once when the JSP is first requested or when it has been modified. The web container compiles the JSP into a servlet class and caches it. Subsequent requests execute the already-compiled servlet without retranslation. This makes JSP processing efficient after the initial compilation.