0

programming languages Online Quiz - 222

Description: programming languages Online Quiz - 222
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

Can there be multiple tag inside tag in tiles-defs.xml?

  1. yes

  2. no

  3. None of the above

  4. It Depends.


Correct Option: A

If you have created a custom ActionMapping subclass with the property "service", you can initialize the value to "selectRecord" using

  1. None of Above


Correct Option: B

In Struts 1.1, you can change how Struts populates a form by

  1. Overriding the populate method of the ActionForm

  2. Overriding the processPopulate method of the Request Processor

  3. Overriding the populateBean method of the ActionMapping

  4. All of Above


Correct Option: B

AI Explanation

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

Option A) Overriding the populate method of the ActionForm - This option is incorrect. In Struts 1.1, there is no "populate" method in the ActionForm class that can be overridden to change how Struts populates a form.

Option B) Overriding the processPopulate method of the Request Processor - This option is correct. In Struts 1.1, you can change how Struts populates a form by overriding the "processPopulate" method of the Request Processor. This method is responsible for populating the form with data from the request parameters. By overriding this method, you can customize the population process according to your requirements.

Option C) Overriding the populateBean method of the ActionMapping - This option is incorrect. In Struts 1.1, there is no "populateBean" method in the ActionMapping class that can be overridden to change how Struts populates a form.

Option D) All of Above - This option is incorrect. Only option B, overriding the processPopulate method of the Request Processor, is correct for changing how Struts populates a form in Struts 1.1.

The correct answer is B. This option is correct because you can change how Struts populates a form by overriding the "processPopulate" method of the Request Processor.

We can create how many struts config file in an struts application?

  1. Only One

  2. Only Two

  3. Zero

  4. As many we needed


Correct Option: C

Which one is correct?

  1. .

  2. None


Correct Option: A

Org.apache.struts.action.Action class extends?

  1. Object class

  2. Action Servlet

  3. Http Servlet

  4. None Of the above


Correct Option: A

ReuestProcessor is based on following design pattern?

  1. Command Design Pattern

  2. Template Method Design Pattern

  3. Prototype Design Pattern

  4. Singleton Design Pattern


Correct Option: B

What is struts?

  1. A Technology

  2. A Frameworks

  3. A Java Development Tool Kit

  4. A Language.


Correct Option: B

Each Struts Action element is uniquely identified by its

  1. Input attribute

  2. Name attribute

  3. Page attribute

  4. Path attribute


Correct Option: D

AI Explanation

To answer this question, we need to understand the purpose and attributes of the Struts Action element.

The Struts Action element is used to define an action mapping in the Struts configuration file. It specifies the mapping between a URL pattern and a corresponding action class that will handle the request.

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

Option A) Input attribute - This option is incorrect because the input attribute is used to specify the JSP page to forward to if there is a validation error in the form submission.

Option B) Name attribute - This option is incorrect because the name attribute is used to specify the logical name of the action mapping.

Option C) Page attribute - This option is incorrect because there is no page attribute in the Struts Action element.

Option D) Path attribute - This option is correct because the path attribute is used to specify the URL pattern that will trigger the action mapping.

Therefore, the correct answer is option D. The Struts Action element is uniquely identified by its path attribute.

From a MVC perspective, Struts provides the

  1. Model

  2. View

  3. Controller

  4. None of Above


Correct Option: B

AI Explanation

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

Option A) Model - Struts does provide support for handling the model component in the MVC architecture. However, it is not the primary focus of Struts.

Option B) View - This option is correct because Struts provides the view component in the MVC architecture. It offers various features and components like JSP (JavaServer Pages) and custom tag libraries to handle the presentation logic.

Option C) Controller - Struts does provide support for handling the controller component in the MVC architecture. It offers an action-based framework where the controller logic is managed through action classes.

Option D) None of Above - This option is incorrect because Struts does provide support for both the view and controller components in the MVC architecture.

The correct answer is B) View. This option is correct because Struts primarily focuses on providing the view component in the MVC architecture.

The name of the Application Resources file is set by the servlet init-param named

  1. application

  2. resources

  3. ApplicationResources

  4. Messages


Correct Option: A

The tag is:

  1. Always converts HTML markup to entity equivalents, like <

  2. Never converts HTML markup to entity equivalents

  3. Converts markup when filter=true

  4. Converts markup when markup=false


Correct Option: C

To localize Tiles, you can

  1. Create separate configuration files for each locale

  2. Specify an locale for a definition

  3. Either A or B

  4. None of Above


Correct Option: A

What is return type of execute () method?

  1. void

  2. String

  3. ActionForward

  4. ActionMapping


Correct Option: C

How to use ReuestDispatcher to redirect URL ?

  1. None of the above


Correct Option: B

If validate="true" in struts-config.xml action tag then what is the sequence of execution?

  1. Validate () method of ActionForm, if error return to error.jsp

  2. Validate () method of ActionForm, execute () of Action, if error return to jsp mentioned in input tag.

  3. Validate () method of ActionForm, if error return to jsp mentioned in input tag.

  4. None of the above


Correct Option: C

Reset () method of ActionForm returns?

  1. ActionErrors

  2. ActionError

  3. void

  4. ActionMapping


Correct Option: C

Is ActionForm serializable ?

  1. true

  2. false

  3. both 1 and 2

  4. None of the above


Correct Option: A

Which is not subclass of DispatchAction class?

  1. MappingDispatchAction

  2. MethodDispatchAction

  3. EventDispatchAction

  4. LookUpDispatchAction


Correct Option: B

Can there be multiple inside ?

  1. may be

  2. can't be

  3. None of the above

  4. no


Correct Option: A
- Hide questions