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 java
  1. Specify the "context root" for each web application

  2. Generate access beans for any enterprise beans

  3. Assign alias names to the attributes of the Entity beans

  4. Map the Entity beans’ attributes to the relational database tables

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

During EAR deployment, the application server allows specifying the web application's context root (URL path) and mapping entity bean abstract persistence schema to actual database tables. These are deployment-time configuration steps that vary by environment.

Multiple choice java
  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

Type 3 and Type 4 drivers are written in 100% Java. Type 4 communicates directly with the database, while Type 3 uses a middleware server. Because they don't require native client library installations, they are suitable for applets (subject to security sandboxing) and servlets, unlike Type 1 and 2.

Multiple choice java
  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

Java applets are small applications designed to be delivered to a user's browser via HTTP and executed within the JVM on the client's machine. Servlets (Option C) run on the server side.

Multiple choice java
  1. There are no public instance variables.

  2. All persistent values are accessed using getxxxand setxxxmethods.

  3. It may have many constructors as necessary.

  4. All of the above are true of a Java bean.

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

A Java Bean must have a no-argument constructor (default or explicit). If it has many constructors, it must include one with no arguments to be a valid Bean. However, Option D ('All of the above are true') claims C is true. Since C (having many constructors) violates the no-arg constructor rule without qualification, D is false. If C is the 'correct' answer for 'what is NOT true', it is factually consistent because C describes a state that violates Bean conventions. The source claims C is the correct answer.

Multiple choice java
  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

When a JSP page is requested, the web container (like Tomcat) translates it into a Java Servlet source file, compiles it, and then executes it. Therefore, a JSP is transformed into a Servlet.

Multiple choice java
  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

JSP is a technology specifically designed for the Java platform. While it allows for HTML/XML markup, the scripting logic and expressions are strictly Java-based. Unlike ASP, which might support VBScript or JScript, JSP relies on the Java Virtual Machine and Java language specifications for its server-side logic.

Multiple choice java
  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 container (servlet processor) developed by the Apache Software Foundation (in collaboration with Sun Microsystems originally) to execute Java Servlets and JSPs.

Multiple choice java
  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
C Correct answer
Explanation

A Java servlet is a server-side component that handles HTTP requests and generates dynamic responses. While JSPs are also used, they are compiled into servlets. Java applications typically run standalone, and applets are client-side components that run in a browser, making servlets the correct server-side response mechanism.

Multiple choice java
  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, like most modern Java Servlet containers, uses a thread-based model. Each request for a JSP/Servlet is handled by a thread from a pre-allocated pool, rather than spawning a new process or using CGI scripts, which is much more efficient.

Multiple choice java
  1. 1,3,4 only

  2. 2,3,4 only

  3. 1,2,4 only

  4. 1,2,3,4

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

The four common mechanisms for session tracking are URL Rewriting, Cookies, Hidden Form Fields, and SSL / Session IDs (often related to User-Authorization). Option C (1,2,4) includes valid methods. Option B (2,3,4) excludes URL Rewriting, which is a valid method. The prompt claims C is correct. However, 'User-Authorization' (3) is also a valid mechanism defined by the servlet specification (using the login config). A strict interpretation of standard 4 mechanisms usually lists 1, 2, 3, and Hidden Fields. C is the 'best' distractor among the options if 3 is considered invalid or if the question implies specific APIs, but 'Hidden Files' is a misnomer for 'Hidden Fields'.

Multiple choice java
  1. Simple Mail Transfer Protocol (SMTP) implementation in Java.

  2. Java Mail API

  3. Both a and b

  4. Neither a and b

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

Historically, sending mail from Java relied on the JavaMail API (Option B), which uses an underlying SMTP implementation. Option A is less precise (an implementation is used, but 'Java Mail API' is the standard answer). However, the source claims A is correct. This likely implies the question asks for the underlying protocol or a specific legacy implementation context (e.g. Sun's SMTP implementation). Option B is the more standard API name, but given the specific claim for A, we look for the logic: JavaMail uses SMTP. Note: Option C 'Both a and b' would normally be most accurate, but if A is the answer, the question might be distinguishing between 'using the API' vs 'using the Protocol implementation'.

Multiple choice .net
  1. Web client

  2. Web server

  3. Visual Studio .NET

  4. Both a and b.

  5. All of the above.

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

To answer this question, the user needs to know the basic components of a web application and their respective roles.

A web application is built using a combination of client-side and server-side technologies, where the client-side is the part of the application that runs on the user's device (such as a web browser), and the server-side is the part that runs on a web server.

Given the options:

A. Web client: This option is incorrect because a web client is the device or software that accesses a web application, such as a web browser. The web application itself does not reside on the web client.

B. Web server: This option is correct. A web server is where a web application resides. The web server hosts the server-side code and serves the application to client devices upon request.

C. Visual Studio .NET: This option is incorrect because Visual Studio .NET is a software development environment and is not related to the deployment of web applications.

D. Both a and b: This option is partially correct, but not complete. While a web client is necessary to access a web application, the application itself does not reside on the client device. The web server is the place where a web application resides and where it is hosted.

E. All of the above: This option is incorrect because Visual Studio .NET is not related to the deployment of web applications. The correct answer is option B.

Therefore, the answer is: B) Web server.

Multiple choice .net
  1. a browser posts a form to the server.

  2. a user’s action activates the handing of a server event.

  3. a server posts a form to the client.

  4. Both a and b.

  5. All of the above.

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

Postback occurs when a form submission sends data back to the server (browser posts form) AND when that action triggers server-side event handling. Both A and B describe aspects of the postback mechanism in web forms.

Multiple choice .net
  1. The server requests an action from the user.

  2. The user activates a server control event.

  3. The browser posts a form to the server.

  4. The server processes a control event.

  5. The server posts a new HTML page.

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

A round trip begins when a user action on the client side triggers a request (postback) to the server. This occurs when a server control event is activated, causing the browser to send data to the server for processing and wait for a response.

Multiple choice .net
  1. the interface and code of a web form are stored in separate files.

  2. only some user actions, such as button clicks, will generate events.

  3. it is best to use server-side control.

  4. web applications should be coded in Visual Basic.

  5. None of the above.

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

Because every round-trip to the server introduces latency, web forms do not trigger a server event for every minor user action (like moving a mouse). Instead, only significant actions like button clicks or specific index changes typically trigger a postback to the server.