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

Multiple choice technology web technology
  1. By thin clients.

  2. By calls to the database.

  3. By the J2EE server.

  4. By the bean's container.

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

Lifecycle methods of Enterprise JavaBeans (EJBs) are managed and invoked automatically by the EJB container at specific stages of the bean's existence. They are not called directly by database queries, thin clients, or the general J2EE application server itself.

Multiple choice technology web technology
  1. GenericServlet

  2. service()

  3. doTrace()

  4. HttpServlet class its a sub class of GenericServlet class

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

HttpServlet extends GenericServlet and provides HTTP-specific functionality through methods like doGet(), doPost(), etc. GenericServlet is protocol-independent while HttpServlet is designed specifically for HTTP processing. Option D correctly identifies this class and its relationship.

Multiple choice technology web technology
  1. no difference

  2. servlet runs slowly than CGI

  3. CGI is a complex process , servlet is easier ie lieght weight component

  4. none of these

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

CGI creates a new process for each request, making it resource-intensive and slower. Servlets run in a single JVM instance and use threading, making them lightweight and more efficient. Option C correctly captures this key architectural difference.

Multiple choice technology web technology
  1. for forward the request

  2. for include the content from the another URL

  3. both of these

  4. only for forward the request

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

The RequestDispatcher interface defines two methods: forward to send a request to another resource, and include to merge another resource's content. Therefore, it is designed for both purposes, making the combined option correct and the single-action distractors incomplete.

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.