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
-
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.
B
Correct answer
Explanation
Modern servlet containers automatically map JSP files - you don't need to configure them in web.xml. The container compiles JSPs into servlets on first access. web.xml configuration is only needed for Servlets and custom URL mappings.
-
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.
-
<% code %>
-
<@jsp code %>
-
<jsp: scriptlet code />
-
<%jsp code %>
A
Correct answer
Explanation
The scriptlet element syntax in JSP is <% code %>. Scriptlets allow embedding Java code directly into JSP pages. The code inside runs during the request processing phase and can generate dynamic content.
-
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
C
Correct answer
Explanation
Both syntax examples (1 and 2) are valid. In option 1, setProperty is nested inside the useBean body. In option 2, setProperty appears after the useBean tag closes. Both approaches work correctly - the nested approach is more compact while the separate approach is more flexible. Therefore option C 'both' is correct.
-
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.