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 programming languages
  1. /WEB-INF

  2. /appserverInstallDirectory/webapps/webappName/WEB-INF/xml

  3. /appserverInstallDirectory/webapps/webappName/WEB-INF

  4. /appserverInstallDirectory/webapps/webappName/WEB-INF/classes

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

According to the servlet specification, web.xml must be in the WEB-INF directory of the web application. This is specified either relative to the web app root (/WEB-INF) or as an absolute path within the application server's webapps directory structure.

Multiple choice technology programming languages
  1. getInitParameterNames()

  2. getInitParameter(String name)

  3. getServletName()

  4. getServletContext()

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

getInitParameter(String name) returns null if the requested parameter does not exist. The other methods (getInitParameterNames returns an Enumeration, getServletName returns a String, getServletContext returns a ServletContext) never return null.

Multiple choice technology programming languages
  1. A runtime error

  2. "Initialization Parameter is: null" written to the console

  3. "Initialization Parameter is: question14" returned to the requester

  4. "Initialization Parameter is: null" returned to the requester

  5. "Initialization Parameter is: question14" written to the console

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

In the deployment descriptor, initParm is configured as a servlet-specific initialization parameter under `. In the servlet code,sc.getInitParameteris called on theServletContext`, which retrieves context-wide parameters rather than servlet-specific ones. Thus, it returns null, making the output 'Initialization Parameter is: null'.

Multiple choice technology programming languages
  1. ParameterNotFoundException is thrown.

  2. Some other exception is thrown.

  3. "Elmore Leonard" is output on the web page

  4. An application failure occurs

  5. null is output on the web page.

  6. A 404 error occurs in the browser.

Reveal answer Fill a bubble to check yourself
D,F Correct answer
Multiple choice technology programming languages
  1. LogFilter, AuditFilter, EncryptionFilter

  2. LogFilter, EncryptionFilter

  3. LogFilter

  4. EncryptionFilter, AuditFilter, LogFilter

  5. EncryptionFilter, LogFilter

  6. AuditFilter, EncryptionFilter, LogFilter

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

Filter execution order prioritizes url-pattern mappings before servlet-name mappings. EncryptionFilter uses a URL pattern matching direct requests, while LogFilter matches by servlet name, placing it second. AuditFilter does not execute because it is configured only for FORWARD dispatchers.

Multiple choice technology programming languages
  1. DispatcherNotFoundException.

  2. Runtime error because of incorrectly formed parameter to getNamedDispatcher() method.

  3. NullPointerException.

  4. ServletB can obtain request attribute javax.servlet.forward.request_uri.

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

The getNamedDispatcher method expects a servlet name, not a path starting with a slash. Passing a path like /ServletB will fail to find the servlet and return null, causing a NullPointerException when dispatcher.forward is called on the resulting null reference.

Multiple choice technology packaged enterprise solutions
  1. JRAD

  2. WSHL

  3. JRLY

  4. BBL

  5. WSDL

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

JOLT (Java Open Language Toolkit) based security requires the JRLY service to be running on the webserver. This service handles the security layer between the webserver and application server. The other options (JRAD, WSHL, BBL, WSDL) are unrelated to JOLT security services.

Multiple choice technology
  1. JAVA Archival

  2. JAVA Archive

  3. JAVA Architecture

  4. JAVA Architect

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

JAR stands for Java Archive, a file format used to aggregate many Java class files and associated metadata into a single file for distribution. It's based on the ZIP format with a specific manifest file.

Multiple choice technology web technology
  1. True

  2. False

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

The statement is False. HTML pages and applets are client-side technologies that execute in the browser on the client machine, not on the J2EE server. The J2EE server serves these resources but doesn't manage or execute them - that happens on the client side.

Multiple choice technology web technology
  1. Application Client

  2. Applet

  3. Java Bean

  4. EJB

  5. Web

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

Java Bean is NOT a J2EE container or application component. The J2EE containers are: Application Client Container, Applet Container, Web Container (for servlets/JSP), and EJB Container (for enterprise beans). JavaBean is a Java class convention for reusable components, not a J2EE container type.

Multiple choice technology web technology
  1. True

  2. False

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

The statement is False. J2EE components cannot interact directly - they must go through protocols and APIs defined by the J2EE specification. For example, web components communicate with EJBs through remote/local interfaces, not direct method calls. This loose coupling enables the container's services (transactions, security, etc.).

Multiple choice technology web technology
  1. message driven bean

  2. entity bean

  3. session bean

  4. page bean

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

Page bean is NOT a valid enterprise bean type. EJB specification defines only three types: session beans (stateful/stateless), entity beans (now replaced by JPA entities), and message-driven beans. There is no such thing as a 'page bean' in EJB.