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 technology architecture
  1. ServletContext gives information about Container

  2. ServletContext gives information about Request

  3. ServletContext gives information about Session

  4. None

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

The ServletContext interface defines a set of methods that a servlet uses to communicate with its servlet container, offering details about the server environment. It does not contain information specific to individual client requests or sessions.

Multiple choice technology architecture
  1. only request, response

  2. only request, response & application

  3. request, response, session & application

  4. none of the above

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

JSP provides several implicit objects that are automatically available: request (HttpServletRequest), response (HttpServletResponse), session (HttpSession), application (ServletContext), out (JspWriter), pageContext, page, config, and exception. Option C correctly identifies the core implicit objects for request handling and session/application management.

Multiple choice technology architecture
  1. ejb-jar.xml

  2. Can be any valid xml containing Web Module name

  3. web.xml

  4. config.xml

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

The web.xml file is the standard deployment descriptor for Java web applications. It contains configuration information such as servlet mappings, filter definitions, welcome file lists, context parameters, security constraints, and other application settings. The web container reads web.xml during application deployment to configure the application.

Multiple choice technology architecture
  1. True

  2. False

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

Servlets are designed to handle multiple concurrent requests efficiently. The servlet container typically maintains a single servlet instance per servlet and creates a separate thread for each request. This allows the same servlet instance to service multiple requests simultaneously. Developers must ensure thread-safe code when handling shared resources.

Multiple choice technology architecture
  1. True

  2. False

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

Servlet containers typically use a thread pool where each request is handled by a separate thread. This makes servlets inherently multi-threaded, requiring careful attention to thread safety when handling shared resources.

Multiple choice technology architecture
  1. getServletInfo()

  2. getInitParameters()

  3. getServletConfig()

  4. None

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

The getServletConfig() method returns the ServletConfig object passed to the init() method. This object provides access to servlet-specific initialization parameters. getServletInfo() returns servlet information, and getInitParameters() is not a standard method.

Multiple choice technology architecture
  1. Java Server Pages

  2. Java Server Programming

  3. Java Service Pages

  4. Java Service Programming

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

JSP stands for Java Server Pages, a server-side technology that enables the creation of dynamic web content with Java code embedded in HTML templates. It simplifies the development of web applications with a presentation-focused approach.

Multiple choice technology architecture
  1. Apache Tomact

  2. Bea WebLogic

  3. Servlets

  4. JSP Engine

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

JSP requires a servlet container with JSP support - Apache Tomcat and BEA WebLogic are such servers. JSP Engine is the component within these servers that processes JSP pages. Servlets themselves are not a runtime environment but rather Java classes.

Multiple choice technology architecture
  1. jar

  2. war

  3. jar, war

  4. jar, war, ear

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

JAR (Java Archive) files contain Java libraries and classes. WAR (Web Application Archive) files are specifically designed for web applications and contain web components like servlets, JSPs, HTML, etc. EAR (Enterprise Archive) files are for J2EE enterprise applications deployed to application servers. Both JAR and WAR files can be deployed in appropriate web servers or servlet containers, making option C correct.