0

web technology Online Quiz - 139

Description: web technology Online Quiz - 139
Number of Questions: 20
Created by:
Tags: web technology
Attempted 0/20 Correct 0 Score 0

Managed servers host the application components and resources which are also deployed and managed as part of the domain.

  1. True

  2. False


Correct Option: A

A domain can have ONLY one cluster.

  1. True

  2. False


Correct Option: B

When using a RequestDispatcher, the use of which method can often lead to an IllegalStateException

  1. read

  2. write

  3. flush

  4. getOutputStream


Correct Option: C

AI Explanation

To answer this question, let's understand the purpose of the RequestDispatcher and the methods mentioned in the options.

The RequestDispatcher interface in Java is used to forward or include a request from a servlet to another resource, such as another servlet, JSP (JavaServer Page), or HTML file. It provides two main methods: forward() and include().

Now let's go through each option to understand why it is correct or incorrect:

Option A) read - This option is incorrect because there is no read method in the RequestDispatcher interface. The RequestDispatcher is used for forwarding or including requests, not for reading data.

Option B) write - This option is incorrect because there is no write method in the RequestDispatcher interface. The RequestDispatcher is not used for writing data.

Option C) flush - This option is correct. Invoking the flush method on the ServletResponse object obtained from getWriter() can often lead to an IllegalStateException. This exception is thrown when the response has already been committed, meaning the response headers have been sent to the client. Once the response is committed, it is not possible to modify the response.

Option D) getOutputStream - This option is incorrect. The getOutputStream method is used to obtain the output stream for writing binary data to the response. It does not lead to an IllegalStateException on its own.

Therefore, the correct answer is option C) flush. This option can often lead to an IllegalStateException when used with a RequestDispatcher.

Which HTTP method is used to show the client what the server is receiving?

  1. HEAD

  2. GET

  3. POST

  4. TRACE

  5. RETURN


Correct Option: D

AI Explanation

To answer this question, you need to understand the different HTTP methods and their purposes.

Option A) HEAD - The HEAD method is used to retrieve the headers of a resource without retrieving the actual content. It is often used to check the status or availability of a resource. This method does not show the client what the server is receiving, so it is incorrect.

Option B) GET - The GET method is used to retrieve a resource from the server. It sends a request to the server to retrieve the content of a resource. While it shows the client the response or content from the server, it does not directly show what the server is receiving. Therefore, it is incorrect.

Option C) POST - The POST method is used to submit data to be processed by the server. It is commonly used for submitting forms or sending data to be stored on the server. This method does not show the client what the server is receiving, so it is incorrect.

Option D) TRACE - The TRACE method is used to show the client what the server is receiving. When a client sends a TRACE request to the server, the server echoes back the received request to the client. This allows the client to see what the server received and how it was processed. Therefore, this option is correct.

Option E) RETURN - The RETURN method is not a standard HTTP method. It is not used in HTTP communication, so it is incorrect.

The correct answer is D) TRACE. This option is correct because the TRACE method is specifically designed to show the client what the server is receiving.

Which statement about jspInit() are true?

  1. It has access to a ServletConfig

  2. It has access to a ServletContext

  3. It is only called once

  4. It can be overridden


Correct Option: A,B,C,D

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) It has access to a ServletConfig - This option is correct. The jspInit() method in JSP has access to a ServletConfig object, which provides information about the JSP's configuration settings.

Option B) It has access to a ServletContext - This option is correct. The jspInit() method in JSP also has access to a ServletContext object, which provides information about the JSP's execution environment.

Option C) It is only called once - This option is correct. The jspInit() method is called only once during the lifecycle of a JSP. It is called when the JSP is initialized or loaded for the first time.

Option D) It can be overridden - This option is correct. The jspInit() method can be overridden in a JSP's Java code. By overriding the jspInit() method, you can provide custom initialization logic for the JSP.

Based on the explanations above, all of the given options (A, B, C, and D) are true. Therefore, the correct answer is A, B, C, D.

Which directives specify an HTTP response that will be of type "image/svg"?(Choose all that apply)


Correct Option: D

AI Explanation

To answer this question, we need to understand the directives used to specify the HTTP response type.

Option A) - This option is incorrect because the "type" attribute is not used to specify the HTTP response type. It is used to specify the content type of the page being included.

Option B) - This option is incorrect because the "mimeType" attribute is not used to specify the HTTP response type. It is used to specify the MIME type of the page being included.

Option C) - This option is incorrect because the "language" attribute is not used to specify the HTTP response type. It is used to specify the scripting language used in the page.

Option D) - This option is correct because the "contentType" attribute is used to specify the HTTP response type. In this case, it specifies that the response will be of type "image/svg".

Therefore, the correct answer is D) . This option is correct because it uses the appropriate directive to specify the HTTP response type as "image/svg".

In an HTML Page with a rich graphical layout, which JSP Standard action can be used to import an image file into the JSP page?

  1. This cannot be done using a JSP Standard action.


Correct Option: E

How would you set a header named "CONTENT-LENGTH" in the HttpServletResonse object?

  1. response.setHeader(CONTENT-LENGTH,"numBytes");

  2. response.setHeader("CONTENT-LENGTH","numBytes");

  3. response.setStatus(1024);

  4. response.setHeader("CONTENT-LENGTH",1024);


Correct Option: B

WebService is defined as programmable web application logic accessible via standard web protocols.

  1. True

  2. False


Correct Option: A

Web Services advantage are:

  1. a. Connect independent, heterogeneous systems

  2. b. Loosely-coupled, message based systems

  3. c. Open protocols on the wire

  4. d. All Of the above


Correct Option: D
  1. a. Java

  2. b. .Net

  3. c. XML

  4. d. A & B


Correct Option: C
  1. a. Simple Oriented Architecture

  2. b. Service Oriented Architecture

  3. c. Simple Object Access

  4. d. Service Object Access


Correct Option: B
  1. a. Service Oriented Architecture Protocol

  2. b. Service Oriented Architecture Program

  3. c. Simple Object Access Protocol

  4. d. Service Object Access Project


Correct Option: C

WSDL stand for:

  1. a. Web Service Description Language

  2. b. Web Source for Description Language

  3. c. Web Service Detection Language

  4. d. Web Service Destructive Language


Correct Option: A

Directory where Web-Service are published used which protocol for consistency across :

  1. a. WSDL

  2. b. Web Services Directory

  3. c. UDDI

  4. d. All of the above


Correct Option: C

UDDI stand for:

  1. a. Universal Description, Discovery, and Integration

  2. b. Universal Directory for Database and Integration

  3. c. Universal Directory for Discovery and Internationalization

  4. d. Unit Description, Discovery, and Integration


Correct Option: A

WSDL standard are define by:

  1. a. IEEE

  2. b. W3C

  3. c. WSDL

  4. d. All Of the above


Correct Option: B

Web Services Listener is used for forwarding the received request to a component that implements the required business logic

  1. True

  2. False


Correct Option: A
  1. a. The Soap Message Format

  2. b. How to send message and receive response

  3. c. Data Encoding

  4. d. A & B only

  5. e. All Of the above


Correct Option: E
- Hide questions