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. Developing the code.

  2. Confidentiality of code

  3. It is very hard to deploy.

  4. Javascript should never be used for Java EE applications. Java EE specification does not mention about javascript.

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

When building UI controls with JavaScript, all the code runs on the client side in the browser. This means the entire source code is visible to anyone who uses View Source or browser developer tools - there's no way to hide or protect it. This exposes business logic, algorithms, and proprietary implementation details. Options A and C are incorrect - JavaScript development is standard and deployment is simply hosting files. Option D is false.

Multiple choice technology architecture
  1. Implementing a solution with guaranteed message delivery.

  2. When there is a need to exchange data between different applications on different platforms.

  3. Application is a rich-GUI with minimal interactions with database

  4. Applications need to exchange data in an an interoperable way.

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

Web Services enable standardized communication between applications across different platforms and technologies. Option B correctly identifies the core use case: exchanging data between heterogeneous systems. Option D complements this with interoperability - a key goal of web services. Option A is incorrect because web services don't guarantee message delivery (that requires WS-ReliableMessaging). Option C describes a scenario where web services add unnecessary complexity.

Multiple choice technology architecture
  1. JAX-WS talks about Web Services where as JAX-RPC is not related to Web Services.

  2. Both use JAXB for data binding

  3. JAX-WS uses JAXB for data binding.

  4. JAX-RPC uses JAXB for data binding.

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

JAX-WS (Java API for XML Web Services) is the modern standard that uses JAXB for XML data binding. JAX-RPC is the older, deprecated API. Option A is wrong because both are web service APIs. Option B claims both use JAXB, which is false - JAX-RPC does not. Option D incorrectly states JAX-RPC uses JAXB. Only JAX-WS uses JAXB.

Multiple choice technology web technology
  1. Servlet

  2. JSP

  3. EJB

  4. All the above

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

EJB (Enterprise JavaBeans) are specifically designed as business components in Java EE architecture. They encapsulate business logic. Servlets handle web requests/responses, JSP handles presentation - neither are business components.

Multiple choice technology web technology
  1. info.xml

  2. web.xml

  3. context.xml

  4. config.xml

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

web.xml is the standard deployment descriptor for Java web applications. It contains configuration for servlets, filters, welcome files, and other web application settings. While context.xml exists (in Tomcat), web.xml is the universal deployment descriptor.

Multiple choice technology web technology
  1. client side program

  2. server side program

  3. both a&b

  4. none

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

Servlets are server-side programs that run in a web container. They handle client requests, typically HTTP requests, and generate dynamic responses. They do NOT run on the client side.

Multiple choice technology web technology
  1. by a particular servlet

  2. web.xml

  3. globally

  4. none

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

Context parameters (defined in web.xml) are application-wide and accessible globally via ServletContext to all servlets and filters in the application. Unlike servlet-specific init parameters, context parameters are shared across the entire application.

Multiple choice technology architecture
  1. Request

  2. Session

  3. Application

  4. Page

  5. All

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

The jsp:useBean standard action supports four scope values: page, request, session, and application. Page scope is default and lasts only for the current page. Request scope lasts for the duration of the HTTP request. Session scope persists across multiple requests from the same user. Application scope is shared across all users and sessions. Since all four are valid options, 'All' is correct.

Multiple choice technology architecture
  1. JSP

  2. Servlet

  3. Both

  4. None of the above

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

In MVC1 architecture, the JSP page acts as the controller, handling both request processing and presentation. The JSP directly receives requests, contains business logic or calls helper beans, and generates the response. This page-centric approach mixes concerns but simplifies development for simple applications. A separate servlet controller is not used in MVC1.

Multiple choice technology architecture
  1. MVC2

  2. MVC1

  3. Both

  4. None of the above

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

MVC2 uses a servlet as a central controller, making it servlet-centric architecture. A single controller servlet receives all requests, determines the appropriate handler, invokes business logic, and selects the view for rendering. This separation provides better maintainability and testability compared to page-centric approaches.

Multiple choice technology architecture
  1. JSP

  2. Servlet

  3. Both

  4. None of the above

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

In MVC2 architecture, a servlet serves as the controller component. The controller servlet receives HTTP requests, delegates business logic processing to appropriate components (often JavaBeans or EJBs), manages session state, and selects the appropriate JSP view for rendering the response. This clear separation of concerns is a key advantage of MVC2.