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 architecture
  1. Parsing JSP using an XML Parser.

  2. Converting JSP into static Html content.

  3. Generating Servlet Code for the Jsp

  4. None

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

JSP translation refers to the process where the JSP container converts the JSP file into a corresponding Servlet source code. This generated servlet is then compiled. The servlet handles requests by generating HTML output. Option A is wrong because JSP uses its own parser, not generic XML. Option B is wrong because JSP becomes dynamic servlet code, not static HTML.

Multiple choice technology architecture
  1. Applets

  2. Web Browsers

  3. Wireless clients.

  4. All the above

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

J2EE supports multiple client types for accessing enterprise applications. Applets are client-side Java programs that run in browsers. Web browsers are the most common J2EE clients using HTTP. Wireless clients include mobile devices and PDAs that access J2EE applications through WAP or similar protocols. Since all three are valid J2EE client types, option D is correct.

Multiple choice technology architecture
  1. True

  2. False

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

The statement is false because while HTTP-based servlets extend HttpServlet, the Servlet API also supports generic servlets that extend javax.servlet.GenericServlet. GenericServlet is protocol-independent and can be used for any protocol, not just HTTP. HttpServlet specifically handles HTTP requests and responses.

Multiple choice technology architecture
  1. True

  2. False

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

The JSP translation to servlet happens only once when the JSP is first requested or when it has been modified. The web container compiles the JSP into a servlet class and caches it. Subsequent requests execute the already-compiled servlet without retranslation. This makes JSP processing efficient after the initial compilation.

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.