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
-
Message
-
Stream,IXMLSerializable
-
Message,Stream
-
Message,Stream or an IXMLSerializable
D
Correct answer
Explanation
In WCF, only Message, Stream, and types implementing IXMLSerializable can be used as parameters for streaming operations. These types support streaming because they can be read and written sequentially without buffering the entire message.
-
Starting the car
-
Authentication
-
Audit trails
-
Adjusting room temperature
A,B,C,D
Correct answer
Explanation
Java Ring is a smart card technology that can be programmed for various applications. All listed uses are theoretically possible implementations - authentication (most common), audit trails (security logging), starting cars (ignition systems), and adjusting room temperature (smart home integration). The question asks what it CAN be used for, not just typical uses.
-
Action Servlet
-
Action Controller
-
JSP
-
All of the above
B
Correct answer
Explanation
In MVC architecture, the Action Controller is responsible for handling user requests and updating the model state. It processes input, executes business logic, and modifies model data as needed. The Action Servlet handles request routing, JSP is for presentation, and neither directly performs model updates. The controller layer is specifically designed for this coordination role.
-
Request
-
Cookie
-
Application context
-
Global Session
D
Correct answer
Explanation
Global Session provides application-wide data persistence across all pages and requests for a specific user. Request scope only lasts for a single HTTP request, Cookie has size limitations and security concerns, and Application context is shared across all users rather than being session-specific.
-
Action Controller
-
Action Servlet
-
JSP
-
PageHandler
D
Correct answer
Explanation
The PageHandler component is responsible for validating user input in the PS Framework architecture. Action Controller manages flow control, Action Servlet handles request dispatching, and JSP is for presentation - none of these are primarily responsible for input validation.
-
Action Servlet
-
Action Controller
-
JSP
-
PS.xml
B
Correct answer
Explanation
The Action Controller is where business services are invoked in the PS Framework's MVC architecture. Action Servlet handles request routing, JSP manages presentation, and PS.xml contains configuration - only the Controller orchestrates business logic.
-
Web.xml
-
AC.xml
-
Manifest
-
None of the above
C
Correct answer
Explanation
The Manifest file is where classpath entries and external JAR dependencies are declared for Java applications. Web.xml configures servlet mappings, AC.xml is not a standard configuration file, making Manifest the correct location for dependency entries.
-
Web.xml
-
Metadata.xml
-
InitializationWebapp.properties
-
Config.xml
C
Correct answer
Explanation
InitializationWebapp.properties is where the PS Framework expects entries for ps.xml location so that the Action Servlet can locate and load the configuration during application startup. Web.xml is for servlet configuration, and the other files are not standard initialization mechanisms.
-
getApplicationID()
-
getSecurityLevel()
-
getSessionBehaviour()
-
None of the above
A
Correct answer
Explanation
getApplicationID() is the minimum required method override for ActionServlet in the PS Framework, as it uniquely identifies the application within the system. getSecurityLevel() and getSessionBehaviour() are optional overrides for specific customization needs.
-
Client Modules
-
Web App Modules
-
EJB Modules
-
All the above
D
Correct answer
Explanation
EAR (Enterprise Archive) files in Java EE can contain multiple module types including web application modules (WAR files), EJB modules (JAR files with enterprise beans), and client application JARs. This modular structure allows packaging complete enterprise applications with all their components.
-
Asyncronous Java eXtensible Language
-
Asyncronous Java XML
-
Asyncronous JavaScript XML
-
Asyncronous J2EE XML
C
Correct answer
Explanation
AJAX stands for Asynchronous JavaScript and XML, a set of web development techniques used to create asynchronous web applications. Distractors are incorrect as they substitute JavaScript with Java or J2EE, which are different languages and platforms, or use 'eXtensible Language' instead of 'and XML'.
-
Embedding of Java code in HTML pages
-
Platform independence
-
Creation of database-driven Web applications
-
Server-side programming capabilities
A
Correct answer
Explanation
JSP's primary advantage over Servlets is allowing Java code to be embedded directly in HTML using scriptlets and expressions. In Servlets, HTML must be embedded within Java strings using out.println(), making HTML-heavy pages cumbersome. JSP reverses this; HTML is the primary content with Java interspersed where needed.
-
jspInit(), _jspService() & jspDestroy()
-
init(), service(), destroy()
-
both 1&2
-
none
A
Correct answer
Explanation
JSP pages are translated into Servlets, and the lifecycle methods reflect this. jspInit() is called once when the JSP is first loaded (like init()). _jspService() handles each request (like service()). jspDestroy() is called when the JSP is unloaded (like destroy()). Options in B are Servlet lifecycle methods, not JSP-specific.
-
View
-
Model
-
Controller
-
none
A
Correct answer
Explanation
In MVC architecture, JSP serves as the View layer, responsible for presenting data to users. JSP's strength is templating and rendering HTML with dynamic content. Servlets typically act as Controllers (handling request processing), and JavaBeans/POJOs serve as Models (data and business logic).
-
Parsing JSP using an XML Parser.
-
Converting JSP into static Html content.
-
Generating Servlet Code for the Jsp
-
none
C
Correct answer
Explanation
JSP translation is the process where the web container converts JSP pages into Java Servlet source code. This happens automatically - the first time a JSP is accessed, it's translated to a Servlet, compiled to bytecode, and then executed. Subsequent requests use the compiled Servlet directly. Options A and B describe parsing or static content generation, not the translation process.