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 programming languages
  1. isUserInRole

  2. getUserPrincipal

  3. getCookies

  4. getHeader

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

isUserInRole(String role) is used to check if the authenticated user belongs to a specified security role. The element in the DD maps a role name used in code (like isUserInRole calls) to an actual security role defined in the container. getUserPrincipal() returns the Principal object, getCookies() retrieves cookies, and getHeader() reads HTTP headers - none of these relate to role-based security reference mapping.

Multiple choice technology programming languages
  1. Model -View-Controller

  2. Business Delegate

  3. Transfer Object

  4. Intercepting filter

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

The Transfer Object pattern (also called Value Object) creates a serializable object containing multiple data items that can be sent to the client in a single method call instead of multiple fine-grained calls. This reduces network roundtrips between client and EJB. MVC is about separation of concerns, Business Delegate reduces coupling between presentation tier and business tier, and Intercepting Filter is about request/response preprocessing.

Multiple choice technology programming languages
  1. doGet

  2. doTrace

  3. doOptions

  4. doError

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

HttpServlet provides doGet(), doPost(), doHead(), doPut(), doDelete(), doOptions(), doTrace(), and do methods for other HTTP verbs. These are the standard service methods you override to handle specific HTTP request types. doError() is not a valid HttpServlet method - error handling is done through HttpServletResponse.sendError() or error-page configuration.

Multiple choice technology programming languages
  1. Server

  2. Request

  3. Application

  4. Context

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

The 'application' implicit object in JSP represents the ServletContext and provides access to application-scope attributes. ServletContext is the object that stores application-wide data and attributes accessible across all sessions. 'request' is for request scope, 'server' is not a standard JSP implicit object, and 'context' is not used for this purpose in JSP.

Multiple choice technology programming languages
  1. A GUI bean deployment utility

  2. Transaction support for all bean types

  3. JNDI 1.2 name space

  4. Remote client views for all bean types

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

EJB 2.0 containers must provide transaction management across all bean types to ensure data integrity. JNDI 1.2 namespace support is mandatory for resource lookup and naming services. GUI deployment tools are vendor-specific conveniences, not specification requirements. Remote client views are optional - beans can have local-only interfaces.

Multiple choice technology programming languages
  1. A Portable finder query text

  2. Container managed persistence

  3. Local interfaces for session beans

  4. XML based deployment descriptors

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

EJB 2.0 introduced several major enhancements: EJB QL for portable finder queries (eliminating the need for Finder methods in home interfaces), enhanced container-managed persistence with relationships (CMR), local interfaces to avoid remote call overhead for co-located beans, and standardized XML deployment descriptors. Local interfaces apply to both session and entity beans, improving performance for in-process calls.

Multiple choice technology programming languages
  1. Relationships can be one-to-one, one-to-many or many-to-many

  2. A get method return type can use java.util.map

  3. A remote interface is required for such a bean to have bi-directional relationship with another entity bean

  4. Such a bean can have relationships with only message-driven beans

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

Container-managed relationships (CMR) in EJB 2.0 support one-to-one, one-to-many, and many-to-many relationships between entity beans. Get methods for relationships return java.util.Collection or java.util.Set, not Map. Remote interfaces are NOT required - local interfaces work fine. Entity beans can only have CMR relationships with other entity beans, not message-driven beans.

Multiple choice technology programming languages
  1. javax.ejb.AccessLocalException

  2. javax.rmi.NoSuchObjectException

  3. javax.ejb.NoSuchEntityException

  4. javax.rmi.StubNotFoundException

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

When a remote client invokes a method on an entity bean that has been removed, the container throws javax.rmi.NoSuchObjectException. This differs from local client views (which throw NoSuchObjectLocalException) and is specifically for RMI-based remote invocations. The exception indicates the referenced EJB object no longer exists.

Multiple choice technology testing
  1. Managed Session and Unmanaged Session

  2. Local Session and Current Session

  3. Current Session and Remote Session

  4. Local Session and Remote Session

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

JProbe supports two session types: Local Session (profiling an application running on the same machine as JProbe) and Remote Session (profiling an application running on a different machine). This allows flexible profiling setups for both local development and production-like environments. The other options (Managed/Unmanaged, Local/Current, Current/Remote) are not JProbe concepts.

Multiple choice technology testing
  1. Starter License, Enterprise License, Edition License

  2. Node Locked Licensing, Per Seat Licensing, Current Licensing, Edition License

  3. Node Locked Licensing, Per Seat Licensing, Concurrent Licensing, Enterprise Licensing

  4. None

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

JProbe licensing supports Node Locked, Per Seat, Concurrent, and Enterprise models to accommodate different organizational deployment and usage needs. The other options are incorrect because they omit concurrent licensing or contain invalid license types like Current Licensing or Starter License.

Multiple choice technology testing
  1. J2EE and J2SE application

  2. Mainframe Applications

  3. C/C++ Applications

  4. Perl Applications

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

JProbe is a Java profiling tool designed specifically for Java applications. J2SE (Java 2 Standard Edition) is the core Java platform for desktop and standalone applications, while J2EE (Java 2 Enterprise Edition) extends it for enterprise applications with web services, EJBs, and other enterprise features. JProbe cannot profile Mainframe, C/C++, or Perl applications as these are completely different technology stacks.

Multiple choice technology web technology
  1. DEBUG method

  2. OPTIONS method

  3. TRACE method

  4. HEAD method

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

The TRACE method echoes the received request back to the client so they can see what the intermediate servers received. It's used for debugging and diagnostic purposes - the final server sends back essentially the same request message it received. OPTIONS asks for available communication options, HEAD returns only headers, and DEBUG is not a standard HTTP method.

Multiple choice technology web technology
  1. /WEB-INF/classes

  2. /classes

  3. /META-INF/classes

  4. /root/classes

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

In a WAR file, compiled Java classes must be stored in /WEB-INF/classes directory following the standard WAR structure. This is part of the servlet specification. The /classes, /META-INF/classes, and /root/classes paths are not standard locations for compiled classes in a WAR file.

Multiple choice technology web technology
  1. setResponseContentType

  2. setContent

  3. setContentType

  4. setType

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

The HttpServletResponse interface has a setContentType(String) method that sets the content type of the response. This method is used to specify the MIME type (like text/html, application/json) and optionally the character encoding. The other options (setResponseContentType, setContent, setType) are not valid methods in HttpServletResponse.

Multiple choice technology
  1. set of instructions that tells the Informatica server how to execute the tasks

  2. object which executes an instance of a mapping

  3. set of reusable transformation

  4. object that represents a set of tasks

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

A session is an object that executes an instance of a mapping in Informatica. It contains runtime configuration information and executes the data transformation logic defined in the mapping, moving data from sources to targets.