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
-
restartcicsmail.properties
-
schedule.xml
-
environment.properties
-
restart_genesys.ksh
A
Correct answer
Explanation
The restartcicsmail.properties file contains ID details of Genesys Q-listeners running on the server, including listener IDs, ports, and connection parameters. This properties file is used to manage and restart Q-listeners.
A
Correct answer
Explanation
xPression (often associated with document composition and content management) is indeed designed with a component-based SOA architecture. It integrates with multiple technology stacks including J2EE (Java), Web Services, JMS (Java Message Service), Microsoft .NET framework, and XML for data interchange.
-
Service to store per-user data throughout session.
-
Service to store per-user data accross sessions i.e. persistently
-
Home page in your web application
-
Menu page in your web application
B
Correct answer
Explanation
The Profile service in ASP.NET provides persistent per-user data storage that persists across multiple sessions, unlike session state which is temporary. It allows storing user-specific preferences and data that survives session expiration. Options C and D are unrelated.
-
Business Delegate
-
Model View Controller
-
Fast Lane Reader
-
View Helper
A
Correct answer
Explanation
The Business Delegate pattern reduces coupling between the presentation tier (Web) and business logic tiers by acting as an intermediary. It hides the complexity of business service lookup and exception handling, providing a clean interface to the web layer. This creates a loose coupling between tiers.
-
ApplicationContext Module
-
AOP Module
-
Core Container Module
-
DAO Module
C
Correct answer
Explanation
The Core Container Module is the foundation of the Spring Framework, providing essential functionality like IoC (Inversion of Control) and dependency injection. BeanFactory, the heart of this module, manages bean configuration and lifecycle. Other modules like AOP, DAO, and ApplicationContext build on this core foundation.
-
Application Context Module
-
AOP Module
-
Core Container Module
-
DAO Module
A
Correct answer
Explanation
The ApplicationContext module extends BeanFactory and adds enterprise features: internationalization (I18N), event publication, resource loading, and validation. This is what makes Spring a complete framework rather than just an IoC container.
-
Application Context Module
-
AOP Module
-
Core Container Module
-
DAO Module
B
Correct answer
Explanation
The AOP (Aspect-Oriented Programming) module enables aspect development for cross-cutting concerns like logging, transactions, security. It implements proxy-based AOP using JDK dynamic proxies or CGLIB.
-
ClassPathXmlApplicationContext
-
FileSystemXmlApplicationContext
-
XmlWebApplicationContext
-
XmlFileSystemApplicationContext
A
Correct answer
Explanation
ClassPathXmlApplicationContext loads bean definitions from XML files on the classpath. Unlike FileSystemXmlApplicationContext (which uses file system paths), it treats paths as class path resources (e.g., 'applicationContext.xml' finds it anywhere on classpath).
-
It has access to a ServletConfig
-
It has access to a ServeletContext
-
It is only called once
-
It can be overridden
A,B,C,D
Correct answer
Explanation
The jspInit() method is called once during JSP initialization, has access to both ServletConfig and ServletContext (via config.getServletContext()), and can be overridden like other JSP lifecycle methods. All four statements are true.
-
<%@ page type ="image/svg"%>
-
<%@ page mimetype="image/svg" %>
-
<% page language="image/svg" %>
-
<% page contentType="image/svg" %>
D
Correct answer
Explanation
The contentType attribute of the page directive defines the MIME type of the HTTP response. While the option contains a minor syntax typo (missing the @ character in the directive prefix), it correctly identifies contentType as the appropriate attribute, whereas type, mimetype, and language are invalid attributes.
-
stream
-
context
-
exception
-
application
C,D
Correct answer
Explanation
JSP implicit objects include exception (available in error pages) and application (representing ServletContext). 'stream' is not a valid implicit object, and 'context' should be 'application' - the actual implicit object name.
-
Both jspInit() and jspDestroy can be overridden
-
Only jspInit() can be overridden
-
Only jspDestroy() can be overridden
-
Only _jspService can be overridden
A
Correct answer
Explanation
Both jspInit() and jspDestroy() are JSP lifecycle methods that can be overridden to customize initialization and cleanup behavior. The _jspService method cannot be overridden as it's auto-generated by the container.
-
You can only disable scripting at the application level
-
You can disable scripting via DD by using <scripting-invalid> element
-
You can disable scripting via DD
-
You can disable scripting programmatically by using the isScriptingEnabled page directive attribute
B
Correct answer
Explanation
Scripting elements can be disabled at the application level using the element in the deployment descriptor (web.xml). They cannot be disabled programmatically via page directive - the isScriptingEnabled attribute does not exist for this purpose.
-
A tag file may be placed in any subdirectory of WEB-INF
-
A tag file may NOT be placed in a JAR file in the WEB-INF/lib directory
-
A tag file must have the file extension of .tag or .tagx
-
A TLD file must be used to map the symbolic tag name to the actual tag file
C
Correct answer
Explanation
Under the JSP specification, tag files must end with either .tag or .tagx extensions. Distractors are incorrect because tag files are restricted to /WEB-INF/tags/ or /META-INF/tags/ inside JARs, can indeed be packaged in JAR files, and do not strictly require a TLD for mapping.
-
getPageContext()
-
findAttribute(String)
-
getAttribute(String, int)
-
getAttribute(String)
C
Correct answer
Explanation
The getAttribute(String, int) method is the most efficient way to access an attribute when you know its scope because it bypasses scope searching. The int parameter is a scope constant (APPLICATION_SCOPE, SESSION_SCOPE, REQUEST_SCOPE, PAGE_SCOPE) that directly accesses the specified scope. getAttribute(String) without scope parameter searches all scopes sequentially, while findAttribute() also searches scopes. getPageContext() returns the PageContext object itself, not the attribute value.