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
  1. Java Server Pages

  2. Java Server Programming

  3. Java Service Pages

  4. Java Service Programming

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. To make controller

  2. To make GUI

  3. In writing business logic

  4. Deprecated

  5. none

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. Apache Tomact

  2. Bea WebLogic

  3. Servlets

  4. JSP Engine

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. A full-featured Web Application Server

  2. It provides supports to the Servlet and JSP

  3. . It includes pooled database access for DB2 and Oracle Relational Databases

  4. Provide support for EJB .

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. <% code %>

  2. <@jsp code %>

  3. <jsp: scriptlet code />

  4. <%jsp code %>

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. page, request, session, application

  2. Page, response, session, application

  3. Page, request, response, session

  4. None

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. useBean

  2. setProperty

  3. getProperty

  4. All

  5. none

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. 1

  2. 2

  3. both

  4. none

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. id and scope

  2. class or beanName,name,property,value.

  3. type and id

  4. name and property

  5. None

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. Save the report to a reporting folder

  2. Save the report to the data directory

  3. Save the report on the TM1 Server

  4. Save the report to an application folder

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology architecture
  1. void setContext()

  2. void ejbLoad()

  3. void ejbDelete()

  4. void ejbEvict()

Reveal answer Fill a bubble to check yourself
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.