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 security

Given url – http://www.abc.com/viewpage.jsp?page=catalog&productid=12345 where page parameter indicate a unique page and the productid retrieves pages for a particular product. How would you optimally configure appscan to test this application? Choose 2 answers

  1. Track the page parameter

  2. Set the link limit to 2

  3. Set the redundant path limit to 5

  4. Ignore the productid parameter

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

Track the page parameter because each value represents a distinct application page that needs testing. Ignore the productid parameter because it's just a filter within pages - testing one productid value per page is sufficient, testing all values creates redundant tests.

Multiple choice technology web technology
  1. Webmagick

  2. Webwidget

  3. Webrick

  4. Weblaunch

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

WEBrick (Web Engine from Ruby) is the built-in web server that ships with Rails. It's included in Ruby's standard library and used by default when you run 'rails server' in development. Options A, B, and D are fictitious names meant to sound similar but don't exist.

Multiple choice technology web technology
  1. Model only

  2. View and Controller

  3. Controller only

  4. Medel and Controller

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

In the MVC architecture, the Controller is responsible for handling incoming HTTP requests from web browsers. It processes the request, interacts with the Model for data operations, and selects the appropriate View for rendering the response. The Model and View don't directly handle browser requests.

Multiple choice technology security
  1. LoginException

  2. EnterpriseSecurityException

  3. SecurityException

  4. IntrusionException

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

The login() method throws SecurityException when authentication fails or security violations occur. This is the standard exception type for security-related failures in this particular API. LoginException and EnterpriseSecurityException are not the correct exception types for this framework, and IntrusionException would be used for detecting malicious behavior patterns, not normal login failures.

Multiple choice technology security
  1. void setNoCacheHeaders(javax.servlet.http.HttpServletResponse response)

  2. void setNoCacheHeaders(javax.servlet.http.HttpServletRequest request)

  3. boolean setNoCacheHeader(javax.servlet.http.HttpServletResponse response)

  4. void setNoCacheHeaders(javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException

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

The setNoCacheHeaders() method takes HttpServletResponse as a parameter because it needs to modify HTTP response headers to prevent caching. Request parameters don't control caching behavior - only response headers like Cache-Control and Pragma do. The method returns void and doesn't throw ServletException as header setting is a straightforward operation.

Multiple choice technology security
  1. encryptHiddenField(java.lang.String value)

  2. addCSRFToken(final java.lang.String href)

  3. verifySecureComm(javax.servlet.http.HttpServletRequest request)

  4. setSafeContentType(javax.servlet.http.HttpServletResponse response)

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

CSRF (Cross-Site Request Forgery) attacks trick authenticated users into performing unwanted actions. Adding CSRF tokens to URLs is a primary defense because the token is unpredictable and tied to the user's session, making forged requests invalid. encryptHiddenField, verifySecureComm, and setSafeContentType address different security concerns like data encryption or transport security, not CSRF specifically.

Multiple choice technology security
  1. It checks if the http request is made on an SSL channel

  2. It checks if the http method is a POST

  3. Both of the above

  4. None of the above

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

isSecureRequest() performs two critical checks: it verifies the request came over SSL/TLS (HTTPS) for encryption in transit, and confirms it's a POST request because sensitive operations should not be performed via GET (which can be cached, logged, or bookmarked). Only checking one of these conditions would be insufficient - both are required for a truly secure request.

Multiple choice technology security
  1. Log Message which gets logged in the log file and not safe to display to users

  2. User Message which is safe to display to users

  3. Both of the above

  4. None of the above

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

EnterpriseSecurityException contains two separate messages: a Log Message (with technical details for debugging, written to logs but unsafe to show users), and a User Message (sanitized, safe to display). This separation prevents information leakage while still providing useful feedback. Single-message exceptions would either leak sensitive info (showing log messages to users) or provide no debugging value.

Multiple choice technology security
  1. An insecure J2EE web application

  2. A framework for analyzing applications that communicate using the HTTP and HTTPS, most common usage is an intercepting proxy

  3. Static Source Code Analyser

  4. Penetration Testing Tool

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

OWASP WebScarab is a security analysis framework that intercepts and analyzes HTTP/HTTPS traffic between a browser and web application. Its most common usage is as an intercepting proxy that allows security testers to inspect, modify, and replay requests to identify vulnerabilities. It is not an insecure application, static analyzer, or dedicated penetration testing tool - it's a traffic analysis framework.

Multiple choice technology security
  1. Nikto

  2. GreaseMonkey

  3. Sqlmap

  4. O2

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

Nikto is an open source web server scanner licensed under GPL that performs comprehensive vulnerability scanning. It checks for outdated server versions, dangerous files/programs, and configuration issues. Sqlmap is for SQL injection testing, O2 is a security tool framework, and GreaseMonkey is a userscript manager for browsers.

Multiple choice technology security
  1. SQL Injection

  2. Denial of Service

  3. XML Injection

  4. All of the above

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

Web services are vulnerable to all three attack types listed. SQL Injection targets database queries, Denial of Service aims to exhaust resources, and XML Injection specifically targets XML parsers used in SOAP/WSDL services. XML External Entity (XXE) attacks are particularly dangerous to web services, making 'All of the above' the correct answer.

Multiple choice technology security
  1. Page Scope

  2. Session Scope

  3. Request Scope

  4. Application Scope

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

Session scope stores data specific to a user's session, persisting across multiple requests from the same user. Page scope is for a single page, request scope exists only for one HTTP request, and application scope is shared across all users and sessions. Session scope is the correct choice for user-specific data that needs to persist during the user's interaction with the application.

Multiple choice technology security
  1. The length of the User's Session

  2. The length of a single HTTP response

  3. The length of a single HTTP request

  4. Until the server is rebooted

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

Request scope exists only for the duration of processing a single HTTP request from when it's received until the response is sent. Session scope spans multiple requests during a user's visit, and application scope persists across all users until server restart.

Multiple choice technology architecture
  1. OWB Design Browser Client

  2. OWB Repository

  3. OWB Client

  4. OWB Runtime Assistant

  5. OWB Runtime Audit Browser

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

The OWB Design Browser Client is a web-based interface for viewing metadata objects, generating reports, and performing lineage analysis (tracing data flow) and impact analysis (determining effects of changes). It provides read-only access to the metadata repository. The OWB Client is for design, Repository is storage, Runtime tools are for execution.

Multiple choice technology architecture
  1. OWB Deployment Manager

  2. OWB Repository

  3. OWB Client

  4. OWB Mapping Compiler

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

The OWB Deployment Manager is the runtime component responsible for deploying mapping definitions and other objects to the target environment, and for executing the deployed ETL processes. It manages the connection between the design-time repository and the runtime execution engine, handling both deployment and execution of data integration workflows. The Repository stores metadata, the Client is for design, and there is no separate Mapping Compiler component.