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
A
Correct answer
Explanation
Servlets use a multi-threaded model where a single servlet instance handles multiple requests concurrently. Each request runs in a separate thread, sharing the same servlet instance, which makes resource-efficient but requires thread-safe coding.
-
getServletInfo()
-
getInitParameters()
-
getServletConfig()
-
none
C
Correct answer
Explanation
The getServletConfig() method returns the ServletConfig object passed to the servlet's init() method. This allows access to initialization parameters and servlet context throughout the servlet's lifecycle.
C
Correct answer
Explanation
HTML and JavaScript are client-side technologies that run in the browser. JSP and Servlets are server-side Java technologies that execute on the web server to generate dynamic content.
-
Java Server Pages
-
Java Server Programming
-
Java Service Pages
-
Java Service Programming
A
Correct answer
Explanation
JSP stands for Java Server Pages. It is a server-side technology that allows developers to embed Java code in HTML pages to create dynamic web content.
-
To make controller
-
To make GUI
-
In writing business logic
-
Deprecated
-
none
B
Correct answer
Explanation
JSP is primarily used for creating the view/presentation layer (GUI) in web applications. It generates HTML that is sent to the browser. Controllers are better implemented as Servlets, and business logic should be in separate Java classes.
-
Apache Tomact
-
Bea WebLogic
-
Servlets
-
JSP Engine
A,B,D
Correct answer
Explanation
JSP requires a servlet container or engine with JSP support to run. Apache Tomcat and Bea WebLogic are application servers/servlet containers. JSP Engine is the generic component that processes JSP. Servlets are Java classes that run inside containers, not platforms themselves.
-
A full-featured Web Application Server
-
It provides supports to the Servlet and JSP
-
. It includes pooled database access for DB2 and Oracle Relational Databases
-
Provide support for EJB .
A,B,C,D
Correct answer
Explanation
IBM WebSphere is a full-featured Java EE application server that supports Servlets, JSP, and EJBs. It includes enterprise features like pooled database access for major databases (DB2, Oracle) and is a comprehensive platform for enterprise Java applications.
-
page, request, session, application
-
Page, response, session, application
-
Page, request, response, session
-
None
A
Correct answer
Explanation
JSP has four standard scopes: page (default), request, session, and application. Response is not a scope - it's an object for sending data back to the client. Scopes determine the lifespan and visibility of data.
-
useBean
-
setProperty
-
getProperty
-
All
-
none
D
Correct answer
Explanation
In JSP, there are three standard JavaBean actions: useBean (to instantiate or locate a bean), setProperty (to set bean property values), and getProperty (to retrieve bean property values). Option D 'All' correctly identifies that useBean, setProperty, and getProperty are all JavaBean actions.
-
id and scope
-
class or beanName.
-
type and id
-
None
-
id and scope
-
class or beanName,name,property,value.
-
type and id
-
name and property
-
None
D
Correct answer
Explanation
The jsp:getProperty action requires exactly two attributes: 'name' (the bean identifier matching the useBean id) and 'property' (the specific property name to retrieve). Option D correctly identifies these two required attributes. Options A, B, and C list incorrect attribute combinations.
-
Save the report to a reporting folder
-
Save the report to the data directory
-
Save the report on the TM1 Server
-
Save the report to an application folder
D
Correct answer
Explanation
To distribute formatted reports through a web browser in TM1, the report must be saved to an application folder. This makes it accessible through the TM1 Web interface. Reporting folders, data directory, and TM1 Server locations are not correct for web distribution.
-
void setContext()
-
void ejbLoad()
-
void ejbDelete()
-
void ejbEvict()
B
Correct answer
Explanation
In EJB (Enterprise JavaBeans), ejbLoad() is a callback method specific to Entity beans that is invoked by the container to synchronize the bean's state with the underlying database. This method is called when the container needs to refresh the entity bean's state from persistent storage.
-
EntityBean
-
StatefulSession Bean
-
MessageDrivenBean
-
StatelessSessionBean
C
Correct answer
Explanation
MessageDrivenBeans in EJB cannot have local or remote interfaces because they are designed to process asynchronous messages via JMS (Java Message Service). Unlike session or entity beans, MessageDrivenBeans are implemented as message listeners and are not intended for direct client invocation through business interfaces.
-
construction
-
destruction
-
activation
-
passivation
-
All the above
E
Correct answer
Explanation
Stateful session beans in EJB undergo all these lifecycle transitions: construction (when created), destruction (when removed), activation (when restored from secondary storage), and passivation (when temporarily serialized). These callbacks allow the bean to manage its state through the complete lifecycle.