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
  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 these

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

SingleThreadModel is an interface used to provide the synchronisation among the servlets.

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

  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 these

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

All the statements are correct.

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. GenericServlet class implements servlet, ServletConfig and serialisable interfaces.

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. 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. The javax.servlet.error.exception gives information about exception type which can be stored and analysed after storing in a java.lang.Class data type.

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

This is an incorrect statement.

Multiple choice
  1. It is an abstract class which provides the number of methods to obtain the various runtime objects of the JSP page.

  2. The instance of JspFactory container class is created by the JSP container.

  3. It is an implicit object.

  4. All of the above

  5. Only (1) and (2)

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

These are correct statements about JspFactory method.

Multiple choice
  1. SC_FORBIDDEN method produces predefined error messages like HTTP error 403.

  2. We can send a custom error message for the error message in SC_FORBIDDEN method.

  3. HttpServletResponse allows to send the error message in the servlet code.

  4. HtttpServletResponse interface provides protocol specific methods.

  5. There can be many objects of a servlet created for a request.

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

Only one object is created at the time of first request by servlet or web container.

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. Both (1) and (2)

  5. None of these

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

This is correct about HttpSessionAttributeListener interface.

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

  2. The contextDestroyed() method determines whether the servlet container is shut down.

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

  4. All of the above

  5. Only (1) and (3)

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

These are correct statements.

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. Both (1) and (2)

  5. None of these

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

The HttpSessionActivateListener interface works for that.

Multiple choice
  1. It is used to provide a reusable combination of different server components.

  2. It provides support to IIS specific languages.

  3. It is used to create dynamic and powerful Web-based business solutions.

  4. It is a mixture of text and HTML tags.

  5. All of these

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

Yes, all are correct.

Multiple choice
  1. SSI is limited to some extent.

  2. These files has information about storage of application specific functions and procedures.

  3. It has the properties to store any of the object's attributes.

  4. It defines the execution environment in networking medium.

  5. Options 1 and 2

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

These are correct statements.

Multiple choice
  1. Response

  2. Request

  3. Entity

  4. PUT

  5. OPTIONS

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

This HTTP message request is the one that is sent from a client to a server and includes the method to be applied to the resource, the identifier of the source and the protocol version in use.