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
-
config.createSessionFactory()
-
config.getSessionFactory()
-
config.buildSessionFactory()
-
config. SessionFactory.newInstance()
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.
-
<hibernate-configuration>
-
<hibernate-config>
-
<hibernate-apps>
-
None of the above
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.
-
Application object.
-
Session object.
-
Response object.
-
Request object.
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.
-
Application object.
-
Session object.
-
Response object.
-
Request object.
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.
-
@Print
-
@StatusBar
-
@MessageBox
-
@MessageBar
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.
-
@Name
-
@FieldName
-
@ThisName
-
@FieldTitle
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.
-
@GetField
-
@GetItemValue
-
@GetFieldvalue
-
@Value
A
Correct answer
Explanation
@GetField is the correct Lotus Notes formula function used to retrieve the value of a field. The other options (@GetItemValue, @GetFieldvalue, @Value) are not standard Lotus Notes formula functions for field value retrieval.
-
AirthmaticFormat
-
CurrencyFormat
-
NumberFormat ==
-
StringBuffer
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.
-
It defines the standard tag that works the same everywhere
-
It is a single library and we can use it in multiple jsp containers
-
It has support for the common structural tasks like iteration and condition
-
All of the above
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.
-
Script language declarations, scriplets and expressions.
-
JSP standard actions
-
JSP standard directives
-
All the Above
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.
-
<%= expressions %>
-
<% code fragment %
-
<%! Declarations %>
-
<%-- comment -- %>
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).
-
readOnly==
-
dynamic
-
static==
-
None of the above
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.
-
Applet
-
Servlet
-
Application
-
Midlet
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.
-
None of the above
-
location
-
exception-type
-
error-page
D
Correct answer
Explanation
In the web application deployment descriptor (web.xml), the `` tag is used to define custom error pages for specific HTTP status codes or Java exception types. The other options are nested elements or incorrect.
-
<% code fragment %>
-
<%= expressions %>
-
<%! Declarations %>
-
<%-- comment -- %>
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 (<% %>, <%= %>, <%! %>).