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
-
True, because they both generate the same SOAP message
-
False, because one is written in Java and the other in C# etc
-
None of the above
-
Both 1 and 2 are correct
A
Correct answer
Explanation
Web services built using different programming languages can interoperate because they generate standardized SOAP messages. The language-specific implementation handles the SOAP creation, but the resulting XML message follows the same specification regardless of whether it's generated by Java, C#, or any other language. This language independence is a key design principle of SOAP-based web services.
-
A new XML parser implementation
-
A standard XML parsing technique
-
A standard XML API that can be used by developers with over an XML parser
-
All of the above
C
Correct answer
Explanation
JAXP (Java API for XML Processing) is a standard API that provides a consistent interface for working with XML parsers in Java. It enables pluggable XML parsers (DOM, SAX, XSLT) without code changes. Option A incorrectly calls it a parser implementation - it's an abstraction layer over parsers. Option B is imprecise - it's an API, not a parsing technique.
A
Correct answer
Explanation
ZK is a server-side framework where ZUML markup and Java code are executed on the server. The framework generates HTML and JavaScript that is sent to the client browser. All business logic, event handling, and component creation happens server-side, with ZK's AJAX engine handling client-server communication seamlessly. This is a fundamental architectural characteristic of ZK.
-
Enables reuse and replacement of components
-
Developer do not have full access to the Framework APIs used by core application
-
Developer can run background services
-
both, b & c
-
None of above
B
Correct answer
Explanation
Android is designed to give developers full access to the same framework APIs that core applications use. Thus, stating developers do not have full access (597001) is false, making it the correct answer here. Other choices like enabling reuse (597000) and running background services (597002) are true statements.
-
open-source
-
Ajax based
-
written in php
-
Event driven
-
written in java
A,B,D,E
Correct answer
Explanation
ZK is a Java-based open-source Ajax framework that uses event-driven architecture. It is NOT written in PHP. ZK enables server-centric UI development with automatic Ajax updates, separating events by desktop and processing them sequentially per desktop.
-
client centric
-
Server Centric
-
Data Centric
-
Process Centric
B
Correct answer
Explanation
ZK uses a server-centric approach where all UI logic and event handling execute on the server. The framework automatically handles Ajax communication between browser and server, abstracting away client-side complexity. This differs from client-centric frameworks like GWT or Angular.
-
Windows GUI application
-
Distributed COM
-
Windows Service
-
Web Service
D
Correct answer
Explanation
Web Services are designed to support interoperable machine-to-machine interaction over a network using standard protocols like HTTP and exchanging payloads in XML formats (such as SOAP). Windows GUI apps, Windows Services, and DCOM do not inherently fit this design pattern.
-
Mapping files can be added to Configuration in the application code
-
They can be configured in hibernate.cfg.xml using the <mapping> elements
-
Both a and b
-
None of the above
C
Correct answer
Explanation
Hibernate mapping files can be configured either programmatically by adding them to the Configuration object in code, or declaratively in hibernate.cfg.xml using elements. Both approaches are valid and often both are used together.
-
Session.createQuery();
-
Session.createCriteria();
-
Session.createSQLQuery();
-
Session.lod();
A
Correct answer
Explanation
HQL (Hibernate Query Language) is used with Session.createQuery() method. This method creates a Query object that executes HQL queries against the database. Session.createCriteria() is for the Criteria API (deprecated in favor of JPA Criteria), and Session.createSQLQuery() is for native SQL queries, not HQL.
-
User defined function
-
Session variable
-
Mapping parameter
-
Session parameter
C
Correct answer
Explanation
Mapping parameters in Informatica PowerCenter are designed to hold values that change between sessions (like dates, file paths, or external values). They're set before session execution. Session variables are runtime-modifiable, while UDFs are for custom logic, making mapping parameters the best choice for frequently changing external values.
B
Correct answer
Explanation
Android uses a different Java virtual machine (Dalvik or ART) and different class libraries than Java ME or Java SE. Android applications are compiled to Dalvik bytecode (.dex format), not standard JVM bytecode. Standard Java ME/SE applications cannot run on Android without significant modification due to these fundamental differences in runtime environment and APIs.
-
Account.Username
-
User.Name
-
Page.Username
-
Environment.Username
D
Correct answer
Explanation
Environment.Username retrieves the Windows identity account name under which the current thread is executing. For ASP.NET applications, this returns the application pool identity (such as NETWORK SERVICE, IIS_APPPOOL, or a custom service account) configured in IIS.
-
Construction
-
Destruction
-
Activation
-
Passivation
-
All the above
E
Correct answer
Explanation
Stateful session beans in EJB (Enterprise JavaBeans) go through several lifecycle callbacks: Construction (when created), Destruction (when removed), Activation (when passivated bean is activated), and Passivation (when temporarily serialized to storage). All four lifecycle states have corresponding callback methods, making 'All the above' the correct answer.
-
RequiresNew
-
Supported
-
Never
-
Mandatory
C
Correct answer
Explanation
The 'Never' transaction attribute in EJB deployment descriptors ensures that a method will never be invoked within an existing transaction context. If called within a transaction, the container throws an exception. 'RequiresNew' always creates a new transaction, 'Supported' runs within existing transaction if present, and 'Mandatory' requires an existing transaction to be present (throws exception if none exists).
B
Correct answer
Explanation
@PrePassivate is an EJB lifecycle callback annotation that can only be applied to ONE method per bean class. Using it on multiple methods would cause a deployment error because the container needs exactly one pre-passivation callback method.