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
-
Session objects
-
Application objects
-
ViewState
-
All the Above
D
Correct answer
Explanation
Session state maintains user-specific data across multiple requests. Application state stores global data shared across all users and sessions. ViewState preserves page state during postbacks within the same page. All three are fundamental ASP.NET state management mechanisms, each serving different scopes and persistence needs. 'All the Above' correctly identifies that all three are valid state management approaches.
-
Server.Transfer
-
Response.Redirect
-
Both A) and B)
-
None of the Above
C
Correct answer
Explanation
Both Server.Transfer and Response.Redirect transfer execution to another page in ASP.NET. Server.Transfer transfers execution on the server-side without requiring a client round-trip, while Response.Redirect sends an HTTP 302 response to redirect the client. Since both methods accomplish page transfer, option C is correct.
-
ASP.NET applications run without a Web Server
-
ASP+ and ASP.NET refer to the same thing
-
ASP.NET is a major upgrade over ASP
-
None of the Above
-
Session.Dump
-
Session.Abandon
-
Session.Exit
-
None of the Above
B
Correct answer
Explanation
In ASP.NET, sessions can be terminated programmatically using the Session.Abandon method. This method ends the current session and clears all session data. Session.Dump and Session.Exit are not valid ASP.NET methods.
-
Master Page
-
Page Class
-
Session Class
-
None of the Above
B
Correct answer
Explanation
All ASP.NET Web Forms inherit from the Page class (System.Web.UI.Page), which provides the base functionality for web pages including the request lifecycle, events, and common properties. Master Pages are used for shared layouts, and Session Class manages session state, not page inheritance.
-
Session objects
-
Application objects
-
ViewState
-
All the Above
D
Correct answer
Explanation
ASP.NET provides multiple state management mechanisms. Session objects store user-specific data, Application objects maintain global application state, and ViewState preserves page state across postbacks. All three are valid approaches.
-
JSP Implementation class file
-
JSP page Implementation class
-
JSP file Implementation class
-
JSP class Implementation file
A
Correct answer
Explanation
When a JSP (JavaServer Page) is compiled by the web container, it generates a Java class file that implements the servlet interface. This generated class is commonly referred to as the JSP Implementation class file. It contains the translated JSP code along with the servlet lifecycle methods.
-
Client information
-
Server information
-
Container information
-
Setup information
B
Correct answer
Explanation
Initialization parameters in Java EE and application servers are used to convey server information to the application developer. These parameters configure server-specific settings, connection pools, JNDI resources, and other server-side operational information that the application needs to know about.
-
Remote Interface
-
Bean Interface
-
Home Interface
-
Bean Class
C
Correct answer
Explanation
The Home Interface in EJB (Enterprise JavaBeans) defines the methods for creating, removing, and finding EJB objects of a specific type. It's the factory interface that clients use to obtain references to EJB objects. The Remote Interface defines business methods, the Bean Class contains the implementation, and the Bean Interface is not a standard EJB term.
-
JSP files,Class files for servlets
-
GIF and HTML files
-
Deployment Descriptor
-
All of above
D
Correct answer
Explanation
A web container contains all the resources required to run a web application, including JSP files, servlet class files, deployment descriptors (web.xml), and static assets like GIF and HTML files. Thus, all of the listed options are correct.
-
/META-INF/classes
-
/classes
-
/root/classes
-
/WEB-INF/classes
D
Correct answer
Explanation
In a standard Java Web Application Archive (WAR) file, compiled Java class files must be placed inside the /WEB-INF/classes directory to be loaded by the web container's classloader.
-
HttpServletRequest
-
HttpServletResponse
-
SessionContext
-
SessionConfig
A
Correct answer
Explanation
In Java EE servlets, the HttpServletRequest interface provides the getSession() method that returns the HttpSession object for the current request. HttpServletResponse is for sending responses, and SessionContext/SessionConfig are not standard servlet APIs for session retrieval.
-
CLR
-
CAS
-
Both A) and B)
-
None of the Above
B
Correct answer
Explanation
Code Access Security (CAS) is the .NET security mechanism that restricts what code can do based on permissions, preventing malicious or buggy code from performing dangerous operations like formatting the hard disk. CLR manages execution but doesn't enforce security boundaries.
B
Correct answer
Explanation
Java Message Service (JMS) is a messaging API that allows Java applications to create, send, receive, and read messages asynchronously. It is a messaging middleware standard, not a web service protocol like SOAP or REST.
-
Namespace
-
Assembly
-
Reference
-
Object
A
Correct answer
Explanation
In web services (specifically using XML and WSDL), namespaces serve the same purpose as packages in programming languages - they organize elements and prevent naming conflicts. Namespaces uniquely identify elements in XML documents.