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

Multiple choice technology web technology
  1. contains which jar file will executed

  2. deployment descriptor file

  3. emty file for future use of servlet

  4. none of these

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. http session

  2. cookies

  3. URL rewriting, hiddenform fields

  4. httpsession,hiddenform fields,rewriting,cookies

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. cookies because user can turn off it

  2. hidden form field because of its performance is moderate

  3. httpsession because no limit for session data and performance is good

  4. Url rewriting becasue its easy

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. yes but then serlvet will not work properly ie can't provide initilization parameters

  2. not possible

  3. sometimes only

  4. none of these

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. GenericServlet normal purpose HttpSerlvet for complex process

  2. both are same but parameters are different

  3. both of above

  4. GenericServlet is protocol independent, HttpServlet is protocol dependent

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. javax.servlet.servletRequest accepts relative path and javax.servlet.servletContext doesn't accepts relative path

  2. both are same

  3. javax.servlet.servletRequest for include and javax.servlet.servletContext for forward

  4. all of above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. Windows Server 2003

  2. MOSS 2007 SDK

  3. .Net Framework 3.0

  4. WSS

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. The App Pool Identity for the web application running SharePoint.

  2. The account for running the SSP in the Server.

  3. The Owner account of the server running SharePoint.

  4. Runs under Anonymous account.

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. A Web Application can be associated to multiple SharePoint Service Provider (SSP).

  2. A Web Application can be associated to one SharePoint Service Provider (SSP) only.

  3. A SharePoint Service Provider (SSP) can provide services to multiple Web Applications.

  4. A SharePoint Service Provider (SSP) can provide services to only one Web Application.

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. splist.asmx

  2. list.asmx

  3. Listdata.asmx

  4. There is no web service available for this purpose.

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. splist.asmx

  2. list.asmx

  3. Listdata.asmx

  4. There is no web service available for this purpose.

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. The server has a built-in JVM.

  2. The browser has a built-in JVM.

  3. The source code is interpreted by the browser.

  4. Applets don''t need a JVM.

Reveal answer Fill a bubble to check yourself
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).

Multiple choice technology programming languages
  1. main method.

  2. start method.

  3. init method.

  4. run method

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. An interactive website

  2. A Java program that is run through a web browser

  3. A type of computer

  4. Java method

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. Extending a web server by providing dynamic web content.

  2. Create a JVM for applets.

  3. Storing information in applets.

  4. Loading buttons and menus.

Reveal answer Fill a bubble to check yourself
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.