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 platforms and products
  1. True

  2. False

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

xPression (often associated with document composition and content management) is indeed designed with a component-based SOA architecture. It integrates with multiple technology stacks including J2EE (Java), Web Services, JMS (Java Message Service), Microsoft .NET framework, and XML for data interchange.

Multiple choice technology web technology
  1. Service to store per-user data throughout session.

  2. Service to store per-user data accross sessions i.e. persistently

  3. Home page in your web application

  4. Menu page in your web application

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

The Profile service in ASP.NET provides persistent per-user data storage that persists across multiple sessions, unlike session state which is temporary. It allows storing user-specific preferences and data that survives session expiration. Options C and D are unrelated.

Multiple choice technology architecture
  1. Business Delegate

  2. Model View Controller

  3. Fast Lane Reader

  4. View Helper

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

The Business Delegate pattern reduces coupling between the presentation tier (Web) and business logic tiers by acting as an intermediary. It hides the complexity of business service lookup and exception handling, providing a clean interface to the web layer. This creates a loose coupling between tiers.

Multiple choice technology web technology
  1. ApplicationContext Module

  2. AOP Module

  3. Core Container Module

  4. DAO Module

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

The Core Container Module is the foundation of the Spring Framework, providing essential functionality like IoC (Inversion of Control) and dependency injection. BeanFactory, the heart of this module, manages bean configuration and lifecycle. Other modules like AOP, DAO, and ApplicationContext build on this core foundation.

Multiple choice technology web technology
  1. Application Context Module

  2. AOP Module

  3. Core Container Module

  4. DAO Module

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

The ApplicationContext module extends BeanFactory and adds enterprise features: internationalization (I18N), event publication, resource loading, and validation. This is what makes Spring a complete framework rather than just an IoC container.

Multiple choice technology web technology
  1. ClassPathXmlApplicationContext

  2. FileSystemXmlApplicationContext

  3. XmlWebApplicationContext

  4. XmlFileSystemApplicationContext

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

ClassPathXmlApplicationContext loads bean definitions from XML files on the classpath. Unlike FileSystemXmlApplicationContext (which uses file system paths), it treats paths as class path resources (e.g., 'applicationContext.xml' finds it anywhere on classpath).

Multiple choice technology programming languages
  1. It has access to a ServletConfig

  2. It has access to a ServeletContext

  3. It is only called once

  4. It can be overridden

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

The jspInit() method is called once during JSP initialization, has access to both ServletConfig and ServletContext (via config.getServletContext()), and can be overridden like other JSP lifecycle methods. All four statements are true.

Multiple choice technology programming languages
  1. <%@ page type ="image/svg"%>

  2. <%@ page mimetype="image/svg" %>

  3. <% page language="image/svg" %>

  4. <% page contentType="image/svg" %>

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

The contentType attribute of the page directive defines the MIME type of the HTTP response. While the option contains a minor syntax typo (missing the @ character in the directive prefix), it correctly identifies contentType as the appropriate attribute, whereas type, mimetype, and language are invalid attributes.

Multiple choice technology programming languages
  1. stream

  2. context

  3. exception

  4. application

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

JSP implicit objects include exception (available in error pages) and application (representing ServletContext). 'stream' is not a valid implicit object, and 'context' should be 'application' - the actual implicit object name.

Multiple choice technology programming languages
  1. Both jspInit() and jspDestroy can be overridden

  2. Only jspInit() can be overridden

  3. Only jspDestroy() can be overridden

  4. Only _jspService can be overridden

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

Both jspInit() and jspDestroy() are JSP lifecycle methods that can be overridden to customize initialization and cleanup behavior. The _jspService method cannot be overridden as it's auto-generated by the container.

Multiple choice technology programming languages
  1. You can only disable scripting at the application level

  2. You can disable scripting via DD by using <scripting-invalid> element

  3. You can disable scripting via DD

  4. You can disable scripting programmatically by using the isScriptingEnabled page directive attribute

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

Scripting elements can be disabled at the application level using the element in the deployment descriptor (web.xml). They cannot be disabled programmatically via page directive - the isScriptingEnabled attribute does not exist for this purpose.

Multiple choice technology programming languages
  1. A tag file may be placed in any subdirectory of WEB-INF

  2. A tag file may NOT be placed in a JAR file in the WEB-INF/lib directory

  3. A tag file must have the file extension of .tag or .tagx

  4. A TLD file must be used to map the symbolic tag name to the actual tag file

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

Under the JSP specification, tag files must end with either .tag or .tagx extensions. Distractors are incorrect because tag files are restricted to /WEB-INF/tags/ or /META-INF/tags/ inside JARs, can indeed be packaged in JAR files, and do not strictly require a TLD for mapping.

Multiple choice technology programming languages
  1. getPageContext()

  2. findAttribute(String)

  3. getAttribute(String, int)

  4. getAttribute(String)

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

The getAttribute(String, int) method is the most efficient way to access an attribute when you know its scope because it bypasses scope searching. The int parameter is a scope constant (APPLICATION_SCOPE, SESSION_SCOPE, REQUEST_SCOPE, PAGE_SCOPE) that directly accesses the specified scope. getAttribute(String) without scope parameter searches all scopes sequentially, while findAttribute() also searches scopes. getPageContext() returns the PageContext object itself, not the attribute value.