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. ServeltRequest

  2. HttpSession

  3. ServletConfig

  4. ServletContext

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

To answer this question, the user needs to know about the different levels of scope in Java web applications.

ServletRequest refers to the request scope, which is the smallest level of scope and lasts only for the duration of a single request.

HttpSession refers to the session scope, which lasts for the duration of a user's session with the web application.

ServletConfig refers to the servlet configuration scope, which is used to pass initialization parameters to a servlet.

ServletContext refers to the application scope, which is the largest level of scope and lasts for the duration of the web application.

Therefore, the correct answer is:

The Answer is: D. ServletContext

Multiple choice technology programming languages
  1. Pojo classes

  2. Poto classes

  3. Session classes

  4. Persistent classes

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

Hibernate uses POJO (Plain Old Java Objects) classes as entity classes. These are simple Java classes with no special requirements (no need to extend specific classes) and use annotations or XML mappings for persistence configuration.

Multiple choice technology programming languages
  1. only one session factory is created

  2. depends on the application developed

  3. depends on thesession interfaces to be created

  4. Atleast 2 factories has to be created

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

A SessionFactory in Hibernate is a heavyweight, thread-safe object that is initialized once during application startup. Because it manages connections and mappings for the database, only one instance is typically created and shared across the entire application, making the other options incorrect.

Multiple choice technology programming languages
  1. maps domain object with the corresponding entity in databse

  2. mapping from property to primary cloumn

  3. generates unique identifiers for instances

  4. declares a persistent ,Java Bean style

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

The element in Hibernate mapping documents declares a persistent property of a Java class following JavaBean conventions. It maps a JavaBean property to a database column but does not handle primary key mapping (that's ) or identifier generation (that's ).

Multiple choice technology web technology
  1. Java servlet paper

  2. Java server Paper

  3. Java Server Pages

  4. None

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

JSP stands for Java Server Pages, which is a server-side technology that extends Servlet capabilities by allowing dynamic content generation with Java code embedded in HTML templates.

Multiple choice technology web technology
  1. init(ServletConfig config)

  2. service( ServletRequest req, ServletResponse res)

  3. destroy( ServletRequest req, ServletResponse res)

  4. destroy()

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

Servlet lifecycle has three key methods: init() for initialization (receives ServletConfig), service() for handling requests (receives request/response objects), and destroy() for cleanup (no parameters). Option C incorrectly shows destroy() with request/response parameters.

Multiple choice technology web technology
  1. They are a part of J2SE1.4

  2. They are not part of J2SE1.4

  3. They provide developers with parser-implementation API to process XML

  4. They do not support validation of XML documents against schema

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

JAXP (Java API for XML Processing) was integrated into J2SE 1.4, making it part of the standard Java platform (option A correct). It provides parser-implementation APIs that enable developers to process and manipulate XML documents through DOM, SAX, and XSLT interfaces (option C correct). Option B is false because JAXP is indeed part of J2SE 1.4. Option D is false because JAXP does support validation of XML documents against schemas (DTD, XSD). These characteristics made JAXP the standard Java XML processing API, eliminating the need for vendor-specific XML parsers.

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. None

  4. Both

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

JAX-RPC supports both code generation directions: from WSDL to Java (client/server stubs) and from Java to WSDL. This bidirectional support enables both top-down (start with WSDL) and bottom-up (start with Java) web service development approaches.

Multiple choice technology web technology
  1. Super Object Assess Protocol

  2. Simple Object Access protocol

  3. Simple Object Assess protocol

  4. Syntax Object Access protocol

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

SOAP stands for Simple Object Access Protocol. It is a protocol for exchanging structured information in web services using XML. The other options are incorrect: 'Assess' is wrong, and 'Syntax' is wrong.

Multiple choice technology web technology
  1. an out of memory error on the client

  2. a SOAP fault

  3. communication failure due to network error

  4. incorrect configuration of stubs

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

RemoteException occurs when a remote method invocation fails. A SOAP fault from a web service translates to a RemoteException in Java clients. Network communication failures during remote calls also trigger RemoteException. Out of memory errors cause runtime exceptions like OutOfMemoryError, not RemoteException. Stub configuration errors cause compilation or initialization exceptions, not RemoteException.

Multiple choice technology web technology
  1. Master Page

  2. Page Class

  3. Session Class

  4. None of the Above

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

All Web forms in ASP.NET inherit from the Page class, which is the base class that provides core functionality for server-side processing, rendering, and lifecycle management. The Page class is part of the System.Web.UI namespace and serves as the foundation for all web pages. Master Pages inherit from Page, not the other way around.

Multiple choice technology web technology
  1. Session.Dump

  2. Session.Abandon

  3. Session.Exit

  4. None of the Above

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

In ASP.NET, Session.Abandon is used to end the current session and release its resources. This method cancels the session and allows the session state to be garbage collected. Dump and Exit are not valid methods on the Session object - Abandon is the correct method for session termination.

Multiple choice technology web technology
  1. Server.Transfer

  2. Response.Redirect

  3. Both A) and B)

  4. None of the Above

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

Server.Transfer transfers execution directly to another page on the server side without requiring a round-trip to the client. It preserves the original URL and does not trigger a new HTTP request. Response.Redirect sends a 302 response to the client, causing a new request, which is slower and changes the URL.