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
-
Developing the code.
-
Confidentiality of code
-
It is very hard to deploy.
-
Javascript should never be used for Java EE applications. Java EE specification does not mention about javascript.
B
Correct answer
Explanation
When building UI controls with JavaScript, all the code runs on the client side in the browser. This means the entire source code is visible to anyone who uses View Source or browser developer tools - there's no way to hide or protect it. This exposes business logic, algorithms, and proprietary implementation details. Options A and C are incorrect - JavaScript development is standard and deployment is simply hosting files. Option D is false.
-
Implementing a solution with guaranteed message delivery.
-
When there is a need to exchange data between different applications on different platforms.
-
Application is a rich-GUI with minimal interactions with database
-
Applications need to exchange data in an an interoperable way.
B,D
Correct answer
Explanation
Web Services enable standardized communication between applications across different platforms and technologies. Option B correctly identifies the core use case: exchanging data between heterogeneous systems. Option D complements this with interoperability - a key goal of web services. Option A is incorrect because web services don't guarantee message delivery (that requires WS-ReliableMessaging). Option C describes a scenario where web services add unnecessary complexity.
-
JAX-WS talks about Web Services where as JAX-RPC is not related to Web Services.
-
Both use JAXB for data binding
-
JAX-WS uses JAXB for data binding.
-
JAX-RPC uses JAXB for data binding.
C
Correct answer
Explanation
JAX-WS (Java API for XML Web Services) is the modern standard that uses JAXB for XML data binding. JAX-RPC is the older, deprecated API. Option A is wrong because both are web service APIs. Option B claims both use JAXB, which is false - JAX-RPC does not. Option D incorrectly states JAX-RPC uses JAXB. Only JAX-WS uses JAXB.
-
dynamic-map
-
dom4j
-
pojo
-
None of the above
C
Correct answer
Explanation
Hibernate's default_entity_mode is set to 'pojo' by default, which means it works with Plain Old Java Objects as the default entity representation mode for mapping.
-
Programmatic configuration
-
using hibernate.properties configuration file
-
using hibernate.cfg.xml
-
all the above
D
Correct answer
Explanation
Hibernate can be configured programmatically using Java code, via a hibernate.properties file, or using hibernate.cfg.xml. All three methods are valid approaches depending on the project requirements.
-
<hibernate-configuration>
-
<session-factory>
-
<mapping>
-
<property>
C
Correct answer
Explanation
The tag in hibernate.cfg.xml is used to add HBM XML resources for the current session factory. Each mapping resource points to an XML file containing entity mappings.
-
Servlet
-
JSP
-
EJB
-
All the above
C
Correct answer
Explanation
EJB (Enterprise JavaBeans) are specifically designed as business components in Java EE architecture. They encapsulate business logic. Servlets handle web requests/responses, JSP handles presentation - neither are business components.
-
.html file
-
.jsp file
-
.img file
-
All the above
-
info.xml
-
web.xml
-
context.xml
-
config.xml
B
Correct answer
Explanation
web.xml is the standard deployment descriptor for Java web applications. It contains configuration for servlets, filters, welcome files, and other web application settings. While context.xml exists (in Tomcat), web.xml is the universal deployment descriptor.
-
client side program
-
server side program
-
both a&b
-
none
B
Correct answer
Explanation
Servlets are server-side programs that run in a web container. They handle client requests, typically HTTP requests, and generate dynamic responses. They do NOT run on the client side.
-
by a particular servlet
-
web.xml
-
globally
-
none
C
Correct answer
Explanation
Context parameters (defined in web.xml) are application-wide and accessible globally via ServletContext to all servlets and filters in the application. Unlike servlet-specific init parameters, context parameters are shared across the entire application.
-
Request
-
Session
-
Application
-
Page
-
All
E
Correct answer
Explanation
The jsp:useBean standard action supports four scope values: page, request, session, and application. Page scope is default and lasts only for the current page. Request scope lasts for the duration of the HTTP request. Session scope persists across multiple requests from the same user. Application scope is shared across all users and sessions. Since all four are valid options, 'All' is correct.
-
JSP
-
Servlet
-
Both
-
None of the above
A
Correct answer
Explanation
In MVC1 architecture, the JSP page acts as the controller, handling both request processing and presentation. The JSP directly receives requests, contains business logic or calls helper beans, and generates the response. This page-centric approach mixes concerns but simplifies development for simple applications. A separate servlet controller is not used in MVC1.
-
MVC2
-
MVC1
-
Both
-
None of the above
A
Correct answer
Explanation
MVC2 uses a servlet as a central controller, making it servlet-centric architecture. A single controller servlet receives all requests, determines the appropriate handler, invokes business logic, and selects the view for rendering. This separation provides better maintainability and testability compared to page-centric approaches.
-
JSP
-
Servlet
-
Both
-
None of the above
B
Correct answer
Explanation
In MVC2 architecture, a servlet serves as the controller component. The controller servlet receives HTTP requests, delegates business logic processing to appropriate components (often JavaBeans or EJBs), manages session state, and selects the appropriate JSP view for rendering the response. This clear separation of concerns is a key advantage of MVC2.