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 web technology
  1. config.createSessionFactory()

  2. config.getSessionFactory()

  3. config.buildSessionFactory()

  4. config. SessionFactory.newInstance()

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

In Hibernate, the Configuration object is used to build a SessionFactory using the buildSessionFactory() method. This reads all configuration files and mappings, then creates the heavyweight SessionFactory instance that manages connections to the database.

Multiple choice technology web technology
  1. <hibernate-configuration>

  2. <hibernate-config>

  3. <hibernate-apps>

  4. None of the above

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

The hibernate.cfg.xml configuration file uses as its root element. This element wraps all Hibernate configuration properties like database connection settings, dialect, and mapping file references.

Multiple choice technology web technology
  1. Application object.

  2. Session object.

  3. Response object.

  4. Request object.

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

The ASP.NET Session object encapsulates and maintains the state of a specific client/browser across multiple HTTP requests. Each user session stores unique data (like login state, cart items) keyed by session ID. Application stores global shared state, Request handles incoming HTTP data, Response sends output.

Multiple choice technology web technology
  1. Application object.

  2. Session object.

  3. Response object.

  4. Request object.

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

The ASP.NET Application object maintains data shared across all users/sessions in the application. Unlike Session (per-user data), Application state is global - any user can read or write it. Request handles per-request data, Response sends output to client. Application is ideal for global counters, shared configuration, or cache data.

Multiple choice technology programming languages
  1. @Print

  2. @StatusBar

  3. @MessageBox

  4. @MessageBar

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

The @StatusBar function displays text on the status bar at the bottom of the Notes client, which performs a similar function to the Lotus Script Print method that outputs to the status bar. @Print doesn't exist in formula language, @MessageBox displays dialog boxes, and @MessageBar is not a valid function.

Multiple choice technology programming languages
  1. @Name

  2. @FieldName

  3. @ThisName

  4. @FieldTitle

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

The @ThisName function returns the name of the current field when used within a field's formula, allowing formulas to reference their own field name dynamically. @Name returns a hierarchical name, @FieldName doesn't exist in formula language, and @FieldTitle is not a standard function.

Multiple choice technology programming languages
  1. AirthmaticFormat

  2. CurrencyFormat

  3. NumberFormat ==

  4. StringBuffer

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

NumberFormat is the correct class for displaying currency/money formats in JSP pages. While the option text has formatting issues (extra '==' characters), NumberFormat.getCurrencyInstance() is the standard way to format monetary values. ArithmeticFormat is misspelled, and CurrencyFormat/StringBuffer are not used for this purpose.

Multiple choice technology programming languages
  1. It defines the standard tag that works the same everywhere

  2. It is a single library and we can use it in multiple jsp containers

  3. It has support for the common structural tasks like iteration and condition

  4. All of the above

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

JSP tag libraries provide standardized tags that work consistently across containers, can be reused across multiple JSP containers, and include support for common structural patterns like iteration and conditional logic. This makes 'All of the above' the correct answer as all individual statements are true.

Multiple choice technology programming languages
  1. Script language declarations, scriplets and expressions.

  2. JSP standard actions

  3. JSP standard directives

  4. All the Above

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

The Java Server Pages (JSP) specification defines scriptlet elements (declarations, scriptlets, expressions), standard actions (like jsp:useBean, jsp:include), and standard directives (page, include, taglib). Therefore, all options are correct.

Multiple choice technology programming languages
  1. <%= expressions %>

  2. <% code fragment %

  3. <%! Declarations %>

  4. <%-- comment -- %>

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

The scriptlet tag <% code fragment %> contains Java code fragments that are executed during page generation. This is different from expressions (<%= %>) which evaluate and print, declarations (<%! %>) which declare class members, and comments (<%-- -- %>) which are ignored. Note: the option has a typo (missing '>' in closing tag).

Multiple choice technology programming languages
  1. readOnly==

  2. dynamic

  3. static==

  4. None of the above

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

The <%@ include file='...' %> directive performs a STATIC include - the file content is inserted into the JSP page at translation/compile time, becoming part of the generated servlet. This is different from the action which includes content dynamically at request time. Note: option text has formatting issues with '==' characters.

Multiple choice technology programming languages
  1. Applet

  2. Servlet

  3. Application

  4. Midlet

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

When a JSP page is first requested, it is translated and compiled into a Servlet. The generated Servlet class extends HttpJspPage and implements the _jspService() method that contains the page logic. This Servlet is then instantiated and handles subsequent requests. Applets, Applications, and Midlets are different Java application types.

Multiple choice technology programming languages
  1. <% code fragment %>

  2. <%= expressions %>

  3. <%! Declarations %>

  4. <%-- comment -- %>

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

The <%-- comment -- %> syntax is used for JSP comments, which are ignored by the JSP container and not sent to the client browser. This is different from HTML comments () which are visible in the page source, and other JSP scripting elements (<% %>, <%= %>, <%! %>).