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
  1. This is an abstract class which extends the Servlet interface.

  2. It provides protocol independent servlet.

  3. This class has getServletInfo(), getServletName() and getInitParameterNames() methods.

  4. This class has getServletInfo(), getServletName() and getValue() methods.

  5. None of the above

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

The getValue() method is not present in the GenericServlet class.

Multiple choice
  1. This is an interface implemented by the servlet.

  2. This is an abstract class which extends the Servlet interface.

  3. The SingleThreadModel ensures that the Servlet will handle one request at a time.

  4. The SingleThreadModel does not have any method.

  5. None of the above

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

This is false about SingleThreadModel. It is an interface which is implemented by the Servlet class.

Multiple choice
  1. The javax.Servlet package defines the various exceptions.

  2. A ServletException is known as the generic exception.

  3. The getRootCause method returns the cause of ServletException.

  4. The UnavaiableException determines that the servlet or filter is not available.

  5. None of the above

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

All of the above are the correct statements.

Multiple choice
  1. This class provides notifications in the ServletContext object.

  2. The contextDestroyed() method determines that the Servlet container is shut down.

  3. The contextInitialized() method determines that the web application is ready to service the request.

  4. Option 1 and 3

  5. It is incorrect. Option 5 is correct answer.

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

All are the correct statements for the ServletContextListener class provide in the Servlet application.

Multiple choice
  1. The class implementing this interface determines the notification about the sessions.

  2. The class implementing this interface determines the notification of changes to the HttpSession object's attribute.

  3. This interface defines a session specific to the user requesting the servlet.

  4. Options 1 and 2

  5. None of the above

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

The HttpSessionActivateListener interface works for that.

Multiple choice
  1. The class implementing this interface determines the notification about the sessions.

  2. The class implementing this interface determines the notification of changes to the HttpSession object's attribute.

  3. This interface defines a session specific to the user requesting the servlet.

  4. Option 1 and 2

  5. None of the above

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

This is correct about HttpSessionAttributeListener interface.

Multiple choice
  1. ServletConfig interface is used to pass the information from the servlet container to the servlet during the servlet initialization.

  2. The getInitParameter() method returns null if the parameter does not exist.

  3. ServletContext object is an interface between the servlet container and a servlet.

  4. The only ServletContext object should be in a web application.

  5. None of the above

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

All the statements are correct.

Multiple choice
  1. These annotations are used to specify information about security within a class file.

  2. These expresses an application’s security structure, including security roles, access control, and authentication requirements in a deployment descriptor.

  3. These security are embedded in an application.

  4. These annotations are used to specify the various threats in an application.

  5. Both (2) and (3)

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

Metadata annotations are used for class file security in Java EE applications.

Multiple choice
  1. It is platform-independent.

  2. It is used to store information about the web services.

  3. It defines the rules for communication for XML.

  4. It a directory of web service interfaces described by WSDL.

  5. It communicates via SOAP.

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

UDDI does not define any rule for XML communication. SOAP is used for that.

Multiple choice
  1. The SOAP message can exchange information by using transport protocol.

  2. SOAP provides a specific binding for the JMS (Java Messaging System) protocol.

  3. A SOAP HTTP request specifies at least two HTTP headers.

  4. It is used to define the rules of communication for the messages.

  5. SOAP can be represented by using XML, RDF and JSON.

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

This is incorrect.