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. Hibernate Architecture

  2. Struts Architecture

  3. MVC Architecture

  4. Web Architecture

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

The PS framework follows MVC (Model-View-Controller) architecture, separating business logic (Model), presentation (View), and request handling (Controller). This is the standard pattern for web frameworks, promoting separation of concerns and maintainability.

Multiple choice technology web technology
  1. 0

  2. 1

  3. 2

  4. 3

  5. 4

  6. Page does not translate.

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

On first access: x=0 (declaration), jspInit() prints 0 then increments x to 1, expression prints 1 then increments to 2, scriptlet prints 2, manual jspInit() prints 2 then increments to 3. Output to page: 1. On second access: x is now 3 (persistent), jspInit() prints 3 then increments to 4, expression prints 4 then increments to 5, scriptlet prints 5, manual jspInit() prints 5 then increments to 6. Output to page: 4. Wait, let me reconsider. The <%! int x = 0; %> is a class-level field, initialized once when the JSP servlet loads. On first page hit: x starts at 0. Expression <%= x++ %> prints 0, x becomes 1. Scriptlet prints 1. jspInit() prints x (1), increments to 2. Output: 0. On second hit: x is 2. Expression prints 2, x becomes 3. Scriptlet prints 3. jspInit() prints 3, increments to 4. Output: 3. Hmm, answer D says 3. But wait, let me trace more carefully. The <%! int x = 0; %> initializes x to 0 once. jspInit() is called by the container when the servlet is initialized, but here it's also called manually. The key is that x persists between requests. If output is 3 on second access, then first access must have output something that left x at 3. Let me trace: First access: x=0. Expression prints 0, x=1. Scriptlet prints 1. jspInit() prints 1, x=2. Page output: 0. Second access: x=2. Expression prints 2, x=3. Scriptlet prints 3. jspInit() prints 3, x=4. Page output: 2. That doesn't match. Let me reconsider.

Multiple choice technology web technology
  1. Web.xml

  2. application.xml

  3. ps.xml

  4. Actionconfig.xml

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

In Java EE applications, the context root is specified in application.xml (for EAR deployments) or can be configured in application server settings. Web.xml defines servlet mappings and filters but not the context root itself. Ps.xml and Actionconfig.xml are not standard Java EE configuration files.

Multiple choice technology web technology
  1. Web.xml

  2. application.xml

  3. ps.xml

  4. Actionconfig.xml

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

The web.xml deployment descriptor is where servlets (via and elements) and security roles (via elements) are configured. This is the standard Java EE configuration file for web applications. Application.xml is for EAR-level configuration, not servlet definitions.

Multiple choice technology web technology
  1. Servlet of the appilcation

  2. Deployment descriptor of the appln

  3. Context root of the application

  4. ps.xml file of the application

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

When a URL is hit, the web container first reads the deployment descriptor (web.xml) to determine how to route the request. The deployment descriptor contains servlet mappings, welcome file lists, and other routing rules. The servlet itself is invoked only after this mapping is resolved.

Multiple choice technology web technology
  1. Page Handler

  2. Action Controller

  3. JSP

  4. Javascript

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

Server-side validations are processed in the Page Handler or server-side controller layer, not in client-side technologies like JavaScript or view technologies like JSP. The Page Handler receives the request first and can validate data before it reaches the business logic or view layer. Action Controllers typically handle routing rather than validation logic.

Multiple choice technology web technology
  1. ec_debug.jsp->Configuration->DomainData->LifeHost

  2. ec_debug.jsp->DomainData->Host.xml

  3. using wasops

  4. ec_debug->Jars->Registered Components->DomainData->Host

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

In WebSphere Commerce, the debugging utility ec_debug.jsp provides comprehensive server configurations. The environment's Life Host region info is specifically displayed under the path Configuration -&gt; DomainData -&gt; LifeHost. The other options list incorrect paths or tools.

Multiple choice technology web technology
  1. 0

  2. 1

  3. 2

  4. 3

  5. 4

  6. Page does not translate.

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

On first access: jspInit() is called once, incrementing x from 0→1. Then <%= x++ %> outputs 1, x becomes 2. On second access (same instance): jspInit() is NOT called again (only called on first load), so x starts at 2. Then <%= x++ %> outputs 2, x becomes 3. The output shown on the web page is 2. However, if interpreting 'output on second access' as the value of x after all operations complete, it would be 3. The claimed answer D (3) assumes this interpretation.

Multiple choice technology web technology
  1. Hibernate Architecture

  2. Struts Architecture

  3. MVC Architecture

  4. Web Architecture

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

The PS (Portal/Process) framework follows MVC (Model-View-Controller) Architecture, which separates application logic into three interconnected components. Hibernate is an ORM framework, Struts is a specific MVC framework, and 'Web Architecture' is too generic to be the correct answer.

Multiple choice technology web technology
  1. The _jspService() method is called from the generated servlet's service() method.

  2. jspInit() is only ever called on the first request to a JSP instance.

  3. jspDestroy() is only ever called on the last request to a JSP instance.

  4. All servlet methods are accessible from the jspInit() method.

  5. You cannot override or provide a no-parameter init() method in a JSP page.

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

Option A is correct: the generated servlet's service() method calls _jspService(). Option D is correct: jspInit() runs in the servlet context, so all servlet methods (including getServletConfig(), getServletContext(), etc.) are accessible. Options B and C are wrong: jspInit() is called once per instance (not once per request), and jspDestroy() is called when the instance is destroyed, not on the last request. Option E is wrong: you CAN override init() via jspInit().

Multiple choice technology web technology
  1. <%= request.getParameter("myParm") %>

  2. <% String s = getInitParameter("myParm"); %>

  3. <% = application.getInitParameter("myParm") %>

  4. <%= config.getInitParameter("myParm"); %>

  5. <%= getParameter("myParm") %>

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

JSP pages have access to the config implicit object (ServletConfig) and can call getInitParameter() on it (option D). Within a JSP declaration or scriptlet, you can also directly call getInitParameter() (option B) because it's inherited from HttpJspBase/Servlet. Options A and E retrieve request parameters (wrong scope). Option C uses application (ServletContext), which retrieves context-wide init params, not JSP-specific ones.

Multiple choice technology programming languages
  1. Stateless session beans doesn’t preserve any state across method calls

  2. Stateful session beans can be accesses by multiple users at the same time

  3. None of the above

  4. Allof the above

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

Stateless session beans do not maintain conversational state across method calls - each call is independent. Stateful session beans maintain state for a specific client and cannot be accessed by multiple users simultaneously.