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 architecture
  1. only request, response

  2. only request, response & application

  3. request, response, session & application

  4. None

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

JSP provides nine implicit objects including request, response, session, application (ServletContext), out, pageContext, page, config, and exception. Option C lists four of the most commonly used ones - while not exhaustive, it's the correct choice among the given options.

Multiple choice technology architecture
  1. True

  2. False

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

A single servlet instance typically handles multiple concurrent requests using a thread-per-request model. The container creates a thread for each request, all executing the same servlet instance's service() method. This makes servlets inherently multi-threaded.

Multiple choice technology architecture
  1. init()

  2. service()

  3. destroy()

  4. Above All

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

The servlet lifecycle consists of three main phases: initialization (init() called once), service (service()/doGet()/doPost() called per request), and destruction (destroy() called once before removal). All three are lifecycle methods, making 'Above All' the correct answer.

Multiple choice technology architecture
  1. True

  2. False

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

Servlets are inherently multi-threaded - a single servlet instance handles multiple concurrent requests, with each request processed in a separate thread. The servlet container manages this threading model automatically.

Multiple choice technology architecture
  1. getServletInfo()

  2. getInitParameters()

  3. getServletConfig()

  4. None

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

The init(ServletConfig) method receives the ServletConfig object as a parameter. The getServletConfig() method returns this ServletConfig object, which contains initialization parameters and servlet configuration. getServletInfo() returns servlet information (author, version etc.), not the config object. getInitParameters() is not a standard method - parameters are accessed via getInitParameter() on the config object.

Multiple choice technology architecture
  1. Java Server Pages

  2. Java Server Programming

  3. Java Service Pages

  4. Java Service Programming

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

JSP stands for Java Server Pages, a server-side technology that enables dynamic web content generation. It simplifies web development by allowing developers to embed Java code directly into HTML pages. The technology is specifically designed for creating platform-independent, dynamically generated web content.

Multiple choice technology architecture
  1. Apache Tomact

  2. Bea WebLogic

  3. Servlets

  4. JSP Engine

Reveal answer Fill a bubble to check yourself
A,B,D Correct answer
Explanation

JSP requires a servlet container with a JSP engine to process and execute pages. Apache Tomcat and BEA WebLogic are application servers that include JSP engines. JSP Engine is a generic term for any container component that can process JSP files. Servlets are a technology, not an execution environment.

Multiple choice technology architecture
  1. useBean

  2. setProperty

  3. getProperty

  4. All

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

JavaBean standard actions in JSP include useBean (instantiate or locate a bean), setProperty (assign values to bean properties), and getProperty (retrieve property values). These three actions provide complete bean manipulation capability in JSP pages without requiring scriptlet code. They simplify working with JavaBeans through declarative syntax.

Multiple choice technology architecture
  1. jar

  2. war

  3. jar, war

  4. jar, war, ear

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

Web servers can deploy JAR files (as libraries or standalone apps) and WAR files (web applications). WAR files are specifically designed for web application deployment with web components. EAR files are for application servers, not basic web servers - they contain multiple modules (WARs, JARs) with deployment descriptors.

Multiple choice technology architecture
  1. Model – Java Class, JSP, View – HTML, Controller – Servlet

  2. Model – Java Class, View – JSP, Controller – Servlet

  3. Model – Java Class, View – JSP, Container – Servlet

  4. Model – Java Beans, View – JSP, HTML, Controller – Servlet, EJB

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

In the MVC (Model-View-Controller) pattern for Java web applications: Model represents the business logic and data (typically Java classes); View handles presentation (JSP pages for rendering HTML); Controller manages user interaction and coordinates Model and View (Servlets receive requests and delegate to appropriate components). Option A incorrectly places HTML as a separate component rather than what JSP generates. Option C is wrong because 'Container' is not an MVC role. Option D adds unnecessary complexity with EJB.

Multiple choice technology architecture
  1. GET

  2. POST

  3. PUT

  4. HEAD

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

To answer this question, the user needs to have a basic understanding of HTTP methods.

An HTTP method is a type of request that a client sends to a server to perform a specific action. HTTP defines several standard methods, each of which is designed to be used for different purposes.

A non-idempotent request is a request that changes the state of the server. This means that if the same request is made multiple times, the result may be different each time.

OPTIONS:

A) GET: This option is not correct. The GET method is used to retrieve data from the server and is considered idempotent. This means that multiple identical requests will return the same response every time.

B) POST: This option is correct. The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server. POST requests are non-idempotent, meaning that multiple identical requests will not produce the same response.

C) PUT: This option is not correct. The PUT method is used to replace all current representations of a target resource with the request payload. Like the POST method, PUT requests are non-idempotent.

D) HEAD: This option is not correct. The HEAD method is used to retrieve the headers that would be returned if the HEAD request's URL was instead requested with the GET method. The HEAD request is considered idempotent because it does not change the state of the server.

Therefore, the correct answer is:

The Answer is: B. POST