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 programming languages
  1. ejbCreate()

  2. ejbPassivate(),

  3. ejbActivate()

  4. All the above

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

Session beans have callback methods that the container invokes at specific lifecycle points. ejbCreate() is called when a bean instance is created. ejbActivate() is called when a passivated bean is activated (moved from secondary storage to memory). ejbPassivate() is called when a stateful session bean is passivated (moved to secondary storage to conserve resources). All three are valid callback methods.

Multiple choice technology programming languages
  1. Java Transaction Service

  2. Java Translation Service

  3. Java Transaction Servlet

  4. Java Translation Servlet

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

JTS (Java Transaction Service) is the Java specification for transaction management. It defines the APIs and architecture for managing transactions across distributed systems in Java EE applications. The other options confuse 'Transaction' with 'Translation' or incorrectly identify it as a Servlet.

Multiple choice technology programming languages
  1. jspInit()

  2. jspDestroy()

  3. _jspService()

  4. None of the above

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

In JSP, the _jspService() method is automatically generated by the container and is responsible for handling HTTP requests. It receives HttpServletRequest and HttpServletResponse objects as parameters, similar to the service() method in servlets. jspInit() is for initialization (no parameters), jspDestroy() is for cleanup (no parameters). Therefore, _jspService() is the correct answer.

Multiple choice technology
  1. GET

  2. send

  3. POST

  4. getXMLHttpRequest

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

In the XMLHttpRequest API, the send() method is used to actually send the HTTP request to the server after it has been opened with open(). GET and POST are request methods passed to open(), not methods themselves. getXMLHttpRequest is not a standard method.

Multiple choice technology web technology
  1. 4

  2. 7

  3. 9

  4. 8

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

JSP provides 9 implicit objects: request, response, out, session, application, config, pageContext, page, and exception. These are automatically available in JSP pages without explicit declaration.

Multiple choice technology web technology
  1. jspInit()

  2. jspservice()

  3. jspDestroy()

  4. All of the above

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

JSP has three life cycle methods: jspInit() is called when the JSP is initialized, _jspService() handles each request (the option has a minor typo omitting the underscore), and jspDestroy() is called when the JSP is taken out of service. All three methods are part of the JSP life cycle.

Multiple choice technology programming languages
  1. <welcome><welcome-file>index.jsp</welcome-file></welcome>

  2. <welcome-file-list><welcome-file>index.jsp</welcome-file></welcome-file-list>

  3. <welcome-files><welcome-file>index.jsp</welcome-file></welcome-files>

  4. <welcome-files> <welcome>index.jsp</welcome></welcome-files>

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

The correct XML syntax for welcome files in web.xml uses the element containing elements. This defines the list of files the server looks for when a user requests a directory URL (like '/').

Multiple choice technology web technology
  1. By sending a mail to websphere_test team

  2. By submitting a work request to WDT team

  3. Either a or b

  4. None of the above

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

In corporate settings using IBM WebSphere, developers typically lack direct system administrative permissions to clear JVM logs on server instances. Submitting a work request to the WebSphere deployment/infrastructure team (WDT) is the correct process.