0

web technology Online Quiz - 100

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

____________ feature of Spring manges the life cycle and configuration of application objects ?

  1. IOC

  2. Container

  3. AOP

  4. MVC Framework


Correct Option: B

___________ includes enterprise service such as JNDI, EJB, e-mail, internalization, validation and scheduling functionality.

  1. Spring Context

  2. Core Container

  3. Spring AOP

  4. Spring DAO


Correct Option: A

Select Spring Modules among following.

  1. Core Container

  2. Bean Factory

  3. Spring ORM

  4. Spring MVC Framework


Correct Option: A,C,D

The process of applying aspects to a target object to create a new proxy object is called _______ ?

  1. Advice

  2. Pointcut

  3. Weaving

  4. Jointpoint


Correct Option: C

HTML: javascript: alert(parseInt(name.value)); What is The Output When The User Enters 99 in the text field ?

  1. 0

  2. 9

  3. 99

  4. Error On Page


Correct Option: C

HTML: javascript: alert(parseInt(name.value)); What is The Output When The User Enters 08 in the text field ?

  1. 8

  2. 0

  3. NaN

  4. 08


Correct Option: B

HTML: javascript: alert(parseInt(name.value)); What is The Output When The User Enters 012 in the text field ?

  1. 12

  2. 0

  3. 10

  4. NaN

  5. None Of These


Correct Option: C

HTML: javascript: alert(parseInt(name.value)); What is The Output When The User Enters 0XAB in the text field ?

  1. 171

  2. NaN

  3. Error On Page

  4. 0

  5. ab


Correct Option: A

HTML: javascript: alert(parseInt(name.value,10)); What is The Output When The User Enters 0XAB in the text field ?

  1. Nan

  2. ab

  3. 0

  4. Error


Correct Option: C

HTML: javascript: alert(parseInt(name.value,10)); What is The Output When The User Enters 08 in the text field ?

  1. Nan

  2. 08

  3. 0

  4. 8


Correct Option: D

Name the class that includes the getSession method that is used to get the HttpSession object.

  1. SessionContext

  2. SessionConfig

  3. HttpServletRequest

  4. HttpServletResponse


Correct Option: C

When using HTML forms which of the folowing is true for POST method? Select the one correct answer.

  1. POST allows users to bookmark URLs with parameters.

  2. The POST method should not be used when large amount of data needs to be transferred.

  3. POST allows secure data transmission over the http method.

  4. POST method sends data in the body of the request.


Correct Option: D

The method getWriter returns an object of type PrintWriter. This class has println methods to generate output. Which of these classes define the getWriter method? Select the one correct answer.

  1. HttpServletRequest

  2. HttpServletResponse

  3. ServletConfig

  4. ServletContext


Correct Option: B
Explanation:

To solve this question, the user needs to know that the getWriter() method returns an object of type PrintWriter, which can be used to generate output. The user must also know which class defines this method.

The getWriter() method is used to return an object of type PrintWriter, which can be used to generate output. This method is defined in the HttpServletResponse class.

Therefore, the correct answer is:

The Answer is: B. HttpServletResponse

Is the following statement true or false. URL rewriting may be used when a browser is disabled. In URL encoding the session id is included as part of the URL

  1. True

  2. False


Correct Option: A

AI Explanation

To answer this question, we need to understand the concepts of URL rewriting and URL encoding.

URL rewriting is a technique used to modify the URL of a web page dynamically. It is commonly used to create user-friendly URLs or to maintain session information. When a browser is disabled, URL rewriting can still be used to modify the URL.

URL encoding, on the other hand, is a technique used to convert special characters into a format that can be transmitted over the internet. It is commonly used to include parameters or data in the URL. The session id can be included in the URL through URL encoding.

Now let's analyze the given statement and each option:

Option A) True - This option is correct. URL rewriting can be used even when a browser is disabled. In this case, the server can still modify the URL to include session information.

Option B) False - This option is incorrect. URL rewriting can be used when a browser is disabled.

The correct answer is A) True. URL rewriting may be used when a browser is disabled, and the session id can be included as part of the URL through URL encoding.

Which of the following statements are correct about the status of the Http response. Select the one correct answer.

  1. A status of 200 to 299 signifies that the request was successful.

  2. A status of 300 to 399 are informational messages.

  3. A status of 400 to 499 indicates an error in the server.

  4. A status of 500 to 599 indicates an error in the client.


Correct Option: A
Explanation:

To answer this question, the user needs to have knowledge about HTTP response status codes.

Now, let's go through each option and explain whether it is correct or incorrect:

A. A status of 200 to 299 signifies that the request was successful. This statement is correct. HTTP status codes in the 200 range indicate that the client's request was successful and the server responded with the requested resource.

B. A status of 300 to 399 are informational messages. This statement is incorrect. HTTP status codes in the 300 range indicate that the server is redirecting the client's request to a different location.

C. A status of 400 to 499 indicates an error in the server. This statement is incorrect. HTTP status codes in the 400 range indicate that the client's request was incorrect or invalid, and the server could not understand it.

D. A status of 500 to 599 indicates an error in the client. This statement is incorrect. HTTP status codes in the 500 range indicate that the server encountered an error while trying to fulfill the client's request.

Therefore, the correct answer is:

The Answer is: A

Name the method defined in the HttpServletResponse class that may be used to set the content type. Select the one correct answer.

  1. setType

  2. setContent

  3. setContentType

  4. setResponseContentType


Correct Option: C

AI Explanation

To answer this question, we need to understand the methods available in the HttpServletResponse class for setting the content type.

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

Option A) setType - This option is incorrect because there is no method named "setType" in the HttpServletResponse class.

Option B) setContent - This option is incorrect because there is no method named "setContent" in the HttpServletResponse class for setting the content type.

Option C) setContentType - This option is correct because the HttpServletResponse class does have a method named "setContentType" that can be used to set the content type.

Option D) setResponseContentType - This option is incorrect because there is no method named "setResponseContentType" in the HttpServletResponse class.

The correct answer is option C) setContentType. This option is correct because the setContentType method is defined in the HttpServletResponse class and is used to set the content type.

A user types the URL http://www.javaprepare.com/scwd/index.html . Which HTTP request gets generated. Select the one correct answer.

  1. GET method

  2. PUT method

  3. POST method

  4. HEAD method


Correct Option: A
Explanation:

To understand the type of HTTP request generated, the user needs to know the following:

  • HTTP request methods
  • The structure of a URL

The HTTP request method indicates the type of action the client wants the server to perform on a resource. The structure of a URL is made up of several parts, including the protocol, domain name, and path.

When a user types the URL http://www.javaprepare.com/scwd/index.html:

Based on this information, the correct answer is:

The Answer is: A (GET method)

The GET method is used to request a representation of the specified resource. In this case, the user is requesting the resource located at http://www.javaprepare.com/scwd/index.html by typing the URL into their web browser. As a result, a GET method HTTP request is generated to retrieve the resource.

Name the location of compiled class files within a war file? Select the one correct answer.

  1. /META-INF/classes

  2. /classes

  3. /WEB-INF/classes

  4. /root/classes


Correct Option: C
Explanation:

To solve this question, the user needs to be familiar with the structure of a war file, which is a compressed file format used to package web applications.

The compiled class files are stored in the /WEB-INF/classes directory inside the war file. Therefore, the correct answer is:

The Answer is: C. /WEB-INF/classes.

Option A (/META-INF/classes) is incorrect because the META-INF directory in the war file contains metadata files, not compiled class files.

Option B (/classes) is also incorrect because there is no such directory in a typical war file.

Option D (/root/classes) is incorrect because there is no root directory in a war file.

Which interface, the GenericServlet class does not implement?

  1. Servlet

  2. ServletConfig

  3. Serializable

  4. ServletContext


Correct Option: D

Among following, which class/interface refers to the Application level scope:

  1. ServeltRequest

  2. HttpSession

  3. ServletConfig

  4. ServletContext


Correct Option: D
Explanation:

To answer this question, the user needs to know about the different levels of scope in Java web applications.

ServletRequest refers to the request scope, which is the smallest level of scope and lasts only for the duration of a single request.

HttpSession refers to the session scope, which lasts for the duration of a user's session with the web application.

ServletConfig refers to the servlet configuration scope, which is used to pass initialization parameters to a servlet.

ServletContext refers to the application scope, which is the largest level of scope and lasts for the duration of the web application.

Therefore, the correct answer is:

The Answer is: D. ServletContext

- Hide questions