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 web technology
  1. page , request , out , application

  2. request , response , session , out

  3. page , request , session , application

  4. request , response , session , application

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

The jsp:useBean action defines four valid scope values: page (default), request, session, and application. The 'out' scope does not exist in JSP - 'out' is an implicit object for writing to the JSPWriter, not a bean scope. Similarly, 'response' is not a valid scope value.

Multiple choice technology databases
  1. Connection Management

  2. Bean Management

  3. Transaction Management

  4. Object relational mapping

  5. Relational Management

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

Hibernate's three main architectural components are Connection Management (handles database connections), Transaction Management (manages ACID transactions and ensures data consistency), and Object Relational Mapping (maps Java objects to database tables). These form the core framework for database interaction. Bean Management and Relational Management are not standard Hibernate architectural components - the framework uses POJOs (Plain Old Java Objects) rather than managing beans directly.

Multiple choice technology databases
  1. To create the connection pool and setup required environment

  2. To configure bean management setup environment

  3. To talk to the database directly with out this configuration file

  4. To create an object and map the data with corresponding object

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

The hibernate.cfg.xml configuration file's primary purpose is to set up the Hibernate environment - database connection parameters (driver class, URL, credentials), dialect, connection pool settings, and other runtime configurations. Option B refers to Spring bean management, Option C is incorrect (you need this file), and Option D describes mapping, not configuration.

Multiple choice technology databases
  1. Session

  2. ApplicationContext

  3. SessionFactory

  4. Hibernate Object

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

The SessionFactory is responsible for creating Session instances. It reads the configuration from hibernate.cfg.xml during initialization and provides a thread-safe factory for creating Sessions. The Session itself is created by SessionFactory, not the other way around. ApplicationContext is a Spring concept.

Multiple choice technology databases
  1. SessionFactory sessionFactory = new Configuration().configure();

  2. SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();

  3. SessionFactory sessionFactory = new Configuration().configure().sessionFactory();

  4. SessionFactory sessionFactory = new Configuration().buildSession();

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

The correct Hibernate API to create a SessionFactory is: new Configuration().configure().buildSessionFactory(). The configure() method reads hibernate.cfg.xml, and buildSessionFactory() constructs the SessionFactory. Option A is incomplete (no buildSessionFactory), Option C has a wrong method name, and Option D is incorrect.

Multiple choice technology databases
  1. Perform Object Java Oriented

  2. Plain Object Java Old

  3. Platform Oriented Java Object

  4. Plain Old Java Object

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

Hibernate works best with POJOs, which stands for Plain Old Java Objects. This programming model emphasizes simple, lightweight Java classes that do not inherit from framework-specific classes or implement restrictive interfaces.

Multiple choice technology databases
  1. Connection Management

  2. Bean Management

  3. Transaction Management

  4. Object relational mapping

  5. Relational Management

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

Hibernate's core architecture comprises Connection Management (database connectivity), Transaction Management (ACID transaction handling), and Object Relational Mapping (mapping Java objects to database tables). Bean Management is a Spring/EJB concept, not part of Hibernate.

Multiple choice technology web technology
  1. Stateless event driven

  2. Streaming API Driven

  3. Static binding of XSD to Java components

  4. All the above

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

JAXB uses static binding of XSD to Java components, meaning Java classes are generated at compile time from the schema. This differs from SAX (stateless event-driven) and StAX (streaming API) which are dynamic parsers.

Multiple choice technology web technology
  1. The Content tree is specific to schema

  2. Content tree is not created dynamically

  3. As there is no extra tree manipulation functionality

  4. As it allows data access through accessor methods

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

JAXB uses memory efficiently because the content tree is not created dynamically - it's generated at compile time from the schema, avoiding runtime overhead. Schema-specific trees (A) and accessor methods (D) don't directly explain efficiency.

Multiple choice technology programming languages
  1. Server in java.net package

  2. ServerSocket in java.util.package

  3. Server in java.util package

  4. ServerSocket in java.net package

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

ServerSocket is the correct class for implementing TCP servers in Java, and it is located in the java.net package, not java.util. Option B incorrectly places ServerSocket in java.util, while options A and C reference a non-existent 'Server' class.

Multiple choice technology web technology
  1. Can be used to generate server side and client side Java (Web Service) code from a WSDL

  2. Can be used to generate a WSDL from Java (Web Service) code

  3. Both A and B

  4. one of the above

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

JAX-RPC supports round-trip development in both directions: it can generate Java stubs (server and client) from WSDL (top-down approach) and generate WSDL from Java interfaces (bottom-up approach). This bidirectional capability is captured in option C. Both A and B individually are incomplete.

Multiple choice technology web technology
  1. A new XML parser implementation

  2. A standard XML API that can be used by developers with over an XML parser

  3. A standard XML parsing technique

  4. none of the above

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

JAXP is a standard Java API that provides a pluggable abstraction layer over different XML parser implementations (like DOM and SAX parsers from various vendors). It does not implement parsing itself but standardizes how developers interact with parsers. Option B correctly describes this abstraction, despite minor phrasing issues.

Multiple choice technology web technology
  1. True

  2. False

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

JAX-RPC implements standard web service specifications (SOAP, WSDL, XML Schema) that ensure cross-platform interoperability. Java web services built with JAX-RPC can consume .NET services and vice versa because both adhere to WS-I standards. This interoperability is a fundamental design goal of web services.