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. As a CGI script

  2. As an independent process

  3. By one of Tomcat's threads

  4. None of the above is correct

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

Tomcat executes JSP pages using threads from its thread pool, not as separate processes or CGI scripts. When a JSP is accessed, Tomcat's threads handle the request within the servlet container's process. This threading model is more efficient than spawning new processes for each request (CGI model).

Multiple choice
  1. A Java application

  2. A Java applet

  3. A Java servlet

  4. None of the above is correct

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

A Java applet is a small application designed to run in a web browser. It is sent to the user via HTTP, invoked on the user's computer using the HTTP protocol, and executes as an application within the browser's JVM. A Java application runs standalone, not via HTTP. A Java servlet runs on the server side, not the client side.

Multiple choice
  1. Java virtual machine

  2. Java compiler

  3. Java bytecode

  4. A Web browser

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

To run a compiled Java program, the machine must have the Java Virtual Machine (JVM) loaded and running. The JVM interprets Java bytecode and executes it on the host machine. The Java compiler is only needed during development to compile source code. Java bytecode is what the JVM executes, not what runs the program. A web browser is not required unless it's an applet.

Multiple choice
  1. Both Type 1 and Type 2

  2. Both Type 1 and Type 3

  3. Both Type 3 and Type 4

  4. Type 4 only

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

JDBC driver Type 3 and Type 4 are pure Java drivers that can be used in either applet or servlet code. Type 3 is a net-protocol driver that converts JDBC calls to a database-independent protocol, while Type 4 is a native-protocol pure Java driver. Type 1 (JDBC-ODBC bridge) and Type 2 (native API partly Java) require native libraries and are platform-dependent, making them unsuitable for applets.

Multiple choice
  1. Java virtual machine

  2. Java compiler

  3. Java bytecode

  4. A Web browser

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

To run a compiled Java program, the machine must have the Java Virtual Machine (JVM) loaded and running. The JVM interprets Java bytecode and executes it on the host machine. The Java compiler is only needed during development to compile source code. Java bytecode is what the JVM executes, not what runs the program. A web browser is not required unless it's an applet.

Multiple choice
  1. Both Type 1 and Type 2

  2. Both Type 1 and Type 3

  3. Both Type 3 and Type 4

  4. Type 4 only

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

JDBC driver Type 3 and Type 4 are pure Java drivers that can be used in either applet or servlet code. Type 3 is a net-protocol driver that converts JDBC calls to a database-independent protocol, while Type 4 is a native-protocol pure Java driver. Type 1 (JDBC-ODBC bridge) and Type 2 (native API partly Java) require native libraries and are platform-dependent, making them unsuitable for applets.

Multiple choice
  1. A Java application

  2. A Java applet

  3. A Java servlet

  4. None of the above is correct

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

A Java applet is a small application designed to run in a web browser. It is sent to the user via HTTP, invoked on the user's computer using the HTTP protocol, and executes as an application within the browser's JVM. A Java application runs standalone, not via HTTP. A Java servlet runs on the server side, not the client side.

Multiple choice
  1. Apache Tomcat

  2. Apache Web server

  3. Sun servlet processor

  4. None of the above is correct

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

Apache Tomcat is the servlet processor developed jointly by the Apache Foundation and Sun Microsystems. Tomcat is an open-source web server and servlet container that implements Java Servlet and JavaServer Pages (JSP) technologies. The Apache Web server serves static content but doesn't process servlets. There is no 'Sun servlet processor' as a separate product.

Multiple choice
  1. VBScript only

  2. Jscript only

  3. Java only

  4. All of the above are supported

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

Java Server Pages (JSP) supports Java only for scripting and programming. JSP technology allows embedding Java code in HTML pages using scriptlets, expressions, and declarations. VBScript and JScript are Microsoft technologies used in Active Server Pages (ASP), not JSP. JSP was specifically designed to work with Java, not multiple languages.

Multiple choice
  1. Java applet.

  2. Java servlet.

  3. Either 1 or 2 above.

  4. Neither 1 nor 2 above.

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

JSP (JavaServer Pages) pages are translated into Java servlets by the web container at runtime or during deployment. This servlet generates the dynamic content that gets sent to the client. The servlet container handles this compilation process automatically.

Multiple choice
  1. JVM is platform independent.

  2. JVM is platform dependent.

  3. JVM is responsible for generating byte code.

  4. JVM generates .class files.

  5. None of the above

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

JVM is platform dependent and each OS has different types of JVM.