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. Using the <jsp:readParam/> action

  2. Using the <jsp:getParam/> action

  3. Use the request.getParameter() method

  4. Use the response.getParameter() method

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Parameters passed via within a action become standard request parameters in the included page. The included page accesses these using the familiar request.getParameter() method, just like parameters from an HTML form or URL query string.

Multiple choice technology web technology
  1. <jsp:synchronize name="BeanName" />

  2. <jsp:setProperty name="BeanName" property="" />

  3. <jsp:setProperty name="BeanName" property="*" />

  4. <jsp:setProperty name="BeanName" property="All" />

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Using property="*" in automatically matches all request parameter names to bean property names. If the form has fields named firstName and lastName, and the bean has properties with the same names, they're populated automatically. This is a convenient shortcut for form-to-bean synchronization.

Multiple choice technology web technology
  1. web.xml

  2. servlet.mappings

  3. servlet.xml

  4. Servlet.java

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The web.xml file is the standard deployment descriptor for Java web applications. It contains servlet mappings, servlet definitions, and other configuration elements. Servlet.mappings and servlet.xml are not standard files.

Multiple choice technology web technology
  1. True

  2. False

  3. Can't say

  4. None of these

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Servlets and JSP are widely adopted Java technologies for web development. All major application servers (Tomcat, WebSphere, WebLogic, JBoss) and web servers (Apache with modules, IIS) support them either natively or through plugins.

Multiple choice technology web technology
  1. java.servlet

  2. javax.servlet

  3. .servlet

  4. All are same

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

To solve this question, the user needs to know about the Java Servlets API and its interface.

The correct answer is:

B. javax.servlet

Explanation:

All the servlets must implement the Servlet interface of the javax.servlet package. The javax.servlet package contains a number of interfaces and classes that define the contracts between a servlet class and the runtime environment provided for an instance of such a class by a conforming servlet container. The javax.servlet package provides the base classes for defining HTTP servlets. Thus option B is correct.

Option A is incorrect because there is no package named java.servlet.

Option C is incorrect because the option is incomplete and doesn't provide the package name.

Option D is incorrect because there is only one correct option, and that is option B.

Therefore, the answer is: B. javax.servlet

Multiple choice technology web technology
  1. HttpServletResponce

  2. HttpRequest

  3. ServletRequest

  4. HttpServletRequest

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The servlet container creates an HttpServletRequest object representing the client request and passes it to the service() method (which then delegates to doGet(), doPost(), etc.). This object contains request metadata, parameters, headers, and session info.

Multiple choice technology web technology
  1. Cookies

  2. URL rewriting

  3. HttpSessions

  4. Hidden tags

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

HttpSession stores state on the server side, making it independent of client browser settings. The session ID can be transmitted via cookies or URL rewriting as a fallback, ensuring reliable state management.

Multiple choice technology web technology
  1. They are instantiated every time a request is made

  2. They are a mechanism used by the class loader to download applets

  3. They can be used instead of CGI scripts

  4. They require a web browser that supports JDK 1.1

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Servlets are server-side Java programs that extend server capabilities, typically running in a web container with a single instance handling multiple requests via threading (not reinstantiated per request). They can replace CGI scripts for generating dynamic web content and run entirely on the server, so client browser JDK support is irrelevant. The statement about class loaders downloading applets is unrelated to servlets - that describes applet mechanisms, not servlet technology.

Multiple choice technology web technology
  1. Client side program

  2. Server side program

  3. Both are true

  4. None of these

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

A servlet is a Java program that runs on a server side, typically within a web container. It handles client requests and generates dynamic responses, extending the server's capabilities. Servlets are not client-side programs (like JavaScript), and the question asks for a binary choice between client and server side.

Multiple choice technology web technology
  1. Persistent Objects

  2. Database Tables

  3. Only a

  4. Both a & b

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Hibernate is an ORM (Object-Relational Mapping) framework that maps Java classes (persistent objects) to database tables. The mapping allows Java objects to be persisted to and retrieved from a relational database without writing SQL. Option C is garbled and should read 'Only A'. Option D is incorrect because it's not 'both' - the tables are the destination, not a parallel mapping.

Multiple choice technology web technology
  1. utility classes

  2. Pojo

  3. both 1 & 2

  4. none

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Hibernate uses POJO (Plain Old Java Objects) classes for mapping Java objects to database tables. The mapping is typically done through XML mapping files or Java annotations on POJO classes. Utility classes are not the primary mapping mechanism in Hibernate.