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
-
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.
-
Java applet.
-
Java servlet.
-
Either 1 or 2 above.
-
Neither 1 nor 2 above.
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.
-
JVM is platform independent.
-
JVM is platform dependent.
-
JVM is responsible for generating byte code.
-
JVM generates .class files.
-
None of the above
B
Correct answer
Explanation
JVM is platform dependent and each OS has different types of JVM.
-
java.util package
-
java.lang package
-
java.beans package
-
java.io package
-
java.rmi package
A
Correct answer
Explanation
Collections class is present in java.util package.
-
Standalone application
-
Enterprise application
-
Mobile application
-
Web application
-
None of the above
A
Correct answer
Explanation
These are windows-based applications and also known as desktop applications.
-
Home interface
-
Remote interface
-
Instance passivation
-
containsHeader(java.lang.String name)
-
init()
A
Correct answer
Explanation
It extends javax.ejb.EJBHome, which in turn extends java.rmi.Remote.
-
View components
-
Model components
-
Java beans components
-
WebSphere
-
Query
B
Correct answer
Explanation
Model components of MVC provides program access to information about customers.