Shared Flashcard Set

Details

Struts Qs
n/a
21
Computer Science
Graduate
05/05/2013

Additional Computer Science Flashcards

 


 

Cards

Term

Explain the two models for Struts.

Definition

Model 1: everything under one roof.

Model 2: MVC (Business logic elsewhere).

Term

What is Struts?

Definition
Front web-based framework that follows a MVC design pattern.
Term

Where is the Struts Servlet located?

Definition

 Trick question, it is ran internally.

Term

Define each part of MVC.

Definition

Model: business logic (POJO, Action, ActionForm).

View: what the client sees (JSP & HTML).

Controller: the brain, action servlet.

Term

What are the two types of servers? Explain each server.

Definition

Web server: any server that exclusively deals with HTTP protocol.

Application server: can be used for both HTTP protocol and Enterprise applications.

Term

What is a JavaBean?

Definition
A java class with getters and setters.
Term
What 4 things does the Validator Framework consist of?
Definition

1. Validator plug-in (in struts-config.xml).

2. validation.xml – maps rules to the fields.

3. validator-rules.xml – defines the rules.

4. messageResource.properties.

Term

What are the different types of Struts Librarys?

(Hint: 6)

Definition
HTML, Bean, Logic, Tiles, Template, Nested.
Term

There are two DynaForms, what are they?

Definition

 DynaActionForm and DynaValidatorForm.

Term

What is the difference between DynaActionForm and DynaValidatorForm?

Definition

 DynaValidatorForm has a validate method in it.

Term
What are the attributes of the Action Mappings element? Define each attribute.
Definition

name: redirects to a form-bean element.

path: contains the name of the request received (from html/jsp page).

type: contains the name of the Action class invoked.

scope: specifies the scope in which the Controller (ActionServlet) must look for the bean.

Term

What are the attributes of the form-beans element? Define each attribute.

(Hint: 2)

Definition

name: a unique bean name used as a reference in the  action-mapping element.

type: a fully-qualified classname of the ActionForm class used with the form bean.

Term

What are the attributes of the form-property element? Define each attribute.

(Hint: 2)

Definition

name:contains the name of a property of the form bean.

type: contains the property type such as string.

Term
What do form-beans contain?
Definition
They contain form bean definitions, which creates an ActionForm instance at runtime.
Term
What does a action-mapping contain? What is the tag for each instance?
Definition
It contains the action definitions, with each action mapping defined in a action element.
Term

What are the attributes of the forward element? Define each attribute.

(Hint: 2)

Definition

name: contains the logical name of the forward.

path: contains the path of the resources to which the forward name maps.

Term
What does the forward element do?
Definition
It contains the global forward definition, which maps the logical name to a specific JSP.
Term
What kind of logic should be in the execute() method for Action class?
Definition
Preferable they should contain only presentation logic and be the starting point to invoke business logic.
Term
What does validation.xml do?
Definition
It maps rules to the fields.
Term
What does validator-rules.xml do?
Definition
It defines the rules.
Term
From JSP Page to the Action Class, what classes are called inbetween the two?
Definition
JSP > ActionServlet > RequestProcessor > struts-config > Action Class
Supporting users have an ad free experience!