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
-
contains which jar file will executed
-
deployment descriptor file
-
emty file for future use of servlet
-
none of these
A
Correct answer
Explanation
MANIFEST.MF file in a JAR contains metadata including the Main-Class entry, which specifies which class should be executed when the JAR is run as a standalone application. This is what makes a JAR executable. Option A correctly identifies this purpose.
-
http session
-
cookies
-
URL rewriting, hiddenform fields
-
httpsession,hiddenform fields,rewriting,cookies
D
Correct answer
Explanation
Servlet session management can be implemented through multiple mechanisms: HttpSession API, cookies, URL rewriting (for cookieless sessions), and hidden form fields. Option D correctly lists all these methods together, making it the most complete answer.
-
cookies because user can turn off it
-
hidden form field because of its performance is moderate
-
httpsession because no limit for session data and performance is good
-
Url rewriting becasue its easy
C
Correct answer
Explanation
HttpSession is preferable because it stores session data server-side with no size limit, provides good performance, and doesn't depend on client-side settings. Cookies can be disabled by users, hidden form fields have security limitations, and URL rewriting is cumbersome and has security issues.
-
yes but then serlvet will not work properly ie can't provide initilization parameters
-
not possible
-
sometimes only
-
none of these
A
Correct answer
Explanation
Servlets can have constructors, but the servlet container always calls the no-argument constructor. If you define a constructor with parameters, the container cannot instantiate it properly and initialization parameters will not be available.
-
GenericServlet normal purpose HttpSerlvet for complex process
-
both are same but parameters are different
-
both of above
-
GenericServlet is protocol independent, HttpServlet is protocol dependent
D
Correct answer
Explanation
GenericServlet is protocol-independent and can handle any protocol, while HttpServlet extends GenericServlet specifically for HTTP protocol with HTTP-specific methods like doGet, doPost. HttpServlet is the most commonly used servlet type for web applications.
-
javax.servlet.servletRequest accepts relative path and javax.servlet.servletContext doesn't accepts relative path
-
both are same
-
javax.servlet.servletRequest for include and javax.servlet.servletContext for forward
-
all of above
A
Correct answer
Explanation
ServletRequest.getRequestDispatcher() accepts relative paths and can accept query strings, while ServletContext.getRequestDispatcher() requires absolute paths within the servlet context. Both support forward and include operations.
-
Windows Server 2003
-
MOSS 2007 SDK
-
.Net Framework 3.0
-
WSS
B
Correct answer
Explanation
The SharePoint Object Model is the programming API for interacting with SharePoint sites and data. It is provided through the Microsoft Office SharePoint Server (MOSS) 2007 SDK, which includes the necessary assemblies and documentation. Windows Server 2003 is the OS, .NET Framework 3.0 is the runtime, and WSS is the foundation - none of these provide the object model itself.
-
The App Pool Identity for the web application running SharePoint.
-
The account for running the SSP in the Server.
-
The Owner account of the server running SharePoint.
-
Runs under Anonymous account.
A
Correct answer
Explanation
SPSecurity.RunWithElevatedPrivileges executes code using the Application Pool Identity credentials of the web application. This elevates permissions to run code with higher privileges than the current user. It does NOT use SSP account, server owner, or anonymous access.
-
A Web Application can be associated to multiple SharePoint Service Provider (SSP).
-
A Web Application can be associated to one SharePoint Service Provider (SSP) only.
-
A SharePoint Service Provider (SSP) can provide services to multiple Web Applications.
-
A SharePoint Service Provider (SSP) can provide services to only one Web Application.
B,C
Correct answer
Explanation
In SharePoint 2007, the SSP (Shared Services Provider) architecture establishes a many-to-one relationship where multiple Web Applications can consume services from a single SSP, but each Web Application can only be associated with one SSP at a time. This design centralizes shared services while maintaining clear service boundaries for web applications.
-
splist.asmx
-
list.asmx
-
Listdata.asmx
-
There is no web service available for this purpose.
B
Correct answer
Explanation
The Lists.asmx web service (accessed as list.asmx) provides SOAP-based operations for retrieving and manipulating SharePoint list items in MOSS 2007. This service supports methods like GetListItems to query list data. Option A is incorrect, Option C refers to a REST/OData service introduced in later versions, and web services do exist for this purpose.
-
splist.asmx
-
list.asmx
-
Listdata.asmx
-
There is no web service available for this purpose.
B
Correct answer
Explanation
The Lists.asmx web service (accessed via _vti_bin/lists.asmx) is the primary SOAP web service in SharePoint 2007 for working with lists and list items. It provides methods like GetListItems(), UpdateListItems(), and AddListItems() to query and manipulate list data programmatically. SPLIST.asmx and Listdata.asmx are not standard SharePoint web services.
-
The server has a built-in JVM.
-
The browser has a built-in JVM.
-
The source code is interpreted by the browser.
-
Applets don''t need a JVM.
B
Correct answer
Explanation
Java applets run in browsers because browsers either had built-in JVM support or could install JVM plugins. The JVM executes the applet bytecode, not the browser interpreting source (C). The server doesn't run the applet (A) - it downloads to the client. Applets absolutely require a JVM (D).
-
main method.
-
start method.
-
init method.
-
run method
C
Correct answer
Explanation
When a web browser loads an applet, it first calls the init() method to initialize the applet, similar to a constructor. The start() method is called after init() to begin execution. Option A (main) is for standalone applications. Option D (run) is used with threads, not applets.
-
An interactive website
-
A Java program that is run through a web browser
-
A type of computer
-
Java method
B
Correct answer
Explanation
An applet is a Java program designed to be embedded in HTML pages and executed through a web browser with JVM support. Option A is incorrect because applets are programs, not websites themselves. Option C is nonsensical. Option D is wrong because an applet is a complete program, not a single method.
-
Extending a web server by providing dynamic web content.
-
Create a JVM for applets.
-
Storing information in applets.
-
Loading buttons and menus.
A
Correct answer
Explanation
Servlets are Java programs that extend a web server's capabilities by generating dynamic web content in response to client requests. Option B is incorrect because applets run client-side in browsers, not in a JVM created by servlets. Option C is wrong - servlets don't store applet data. Option D describes GUI programming, not server-side servlets.