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
-
As a CGI script
-
As an independent process
-
By one of Tomcat's threads
-
None of the above is correct
C
Correct answer
Explanation
Tomcat executes JSP pages using threads from its thread pool rather than spawning separate processes or using CGI. When a JSP is requested, Tomcat uses one of its worker threads to execute the compiled servlet (which is what a JSP becomes after compilation), making it much more efficient than CGI scripts or separate processes.
-
Java applet.
-
Java servlet.
-
Either 1 or 2 above.
-
Neither 1 nor 2 above.
B
Correct answer
Explanation
JSP pages are translated into Java servlets by the JSP container. The servlet is then compiled into bytecode and executed by the server. This transformation happens automatically the first time the JSP is accessed or when it's modified. Options A is incorrect because applets run on the client side, not the server.
-
VBScript only
-
Jscript only
-
Java only
-
All of the above are supported
C
Correct answer
Explanation
JSP uses Java as its primary server-side scripting language. While JavaScript may appear in client-side code within JSP pages, the server-side scriptlets and expressions must be written in Java. Options A and B are Microsoft technologies not used in JSP, and D is incorrect because JSP does not support VBScript or JScript.
-
Apache Tomcat
-
Apache Web server
-
Sun servlet processor
-
None of the above is correct
A
Correct answer
Explanation
Apache Tomcat is the servlet container developed jointly by Apache Foundation and Sun Microsystems (now Oracle). It implements Java servlet and JSP specifications. The Apache Web server (option B) serves static content and is not a servlet processor, and there is no official 'Sun servlet processor' product.
-
A Java application
-
A Java applet
-
A Java servlet
-
None of the above is correct
C
Correct answer
Explanation
Java servlets run on the web server and respond to HTTP requests. They are the server-side counterpart to applets. Option A is incorrect because standalone Java applications aren't invoked via HTTP, and B is wrong because applets run client-side in browsers, not on servers.
-
There are no public instance variables.
-
All persistent values are accessed using getxxx and setxxx methods.
-
It may have many constructors as necessary.
-
All of the above are true of a Java bean.
-
As a CGI script
-
As an independent process
-
By one of Tomcat's threads
-
None of the above is correct
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).
-
A Java application
-
A Java applet
-
A Java servlet
-
None of the above is correct
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.
-
Java virtual machine
-
Java compiler
-
Java bytecode
-
A Web browser
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.
-
Both Type 1 and Type 2
-
Both Type 1 and Type 3
-
Both Type 3 and Type 4
-
Type 4 only
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.
-
Java virtual machine
-
Java compiler
-
Java bytecode
-
A Web browser
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.
-
Both Type 1 and Type 2
-
Both Type 1 and Type 3
-
Both Type 3 and Type 4
-
Type 4 only
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.
-
A Java application
-
A Java applet
-
A Java servlet
-
None of the above is correct
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.
-
Apache Tomcat
-
Apache Web server
-
Sun servlet processor
-
None of the above is correct
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.
-
VBScript only
-
Jscript only
-
Java only
-
All of the above are supported
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.